Skip to main content
In this guide, you’ll configure HashiCorp Vault to use AWS KMS for automatic unsealing. By leveraging Cloud Auto Unseal, you eliminate the operational overhead of manual unseal keys and enhance your security posture.

Prerequisites

  • An EC2 instance running Vault
  • A Customer Managed Key (CMK) in AWS KMS (e.g., Vault Unseal Key)

1. Check Current Vault Status

SSH into your Vault server and run:
Example output:
Vault is not yet initialized and uses the default Shamir seal.
By default, Vault uses Shamir’s Secret Sharing for unsealing. We’ll replace this with AWS KMS.

2. Review the Vault Configuration

Open /etc/vault.d/vault.hcl:
There’s no seal stanza yet—this is where we’ll plug in our AWS KMS configuration.

3. Add the AWS KMS Seal Stanza

  1. In the AWS Console, go to KMS → Customer managed keys and copy your CMK ARN (for example: arn:aws:kms:us-east-1:123456789012:key/abcd1234-5678-90ab-cdef-EXAMPLEKEY).
Treat your KMS key ARN and Vault configuration file as sensitive information. Do not expose them in public repositories.
  1. Edit the Vault HCL:
  1. Insert the awskms seal stanza anywhere in the file:
  1. Your complete configuration should now be:

4. Restart Vault and Verify Seal Type

Restart the Vault service:
Check the new status:
Vault is now configured to auto-unseal with AWS KMS, but still needs initialization.

5. Initialize the Vault Cluster

Initialize Vault:
Example output:
Re-run vault status:
Vault is now unsealed automatically via AWS KMS.

6. Use Vault as Usual

Authenticate with the root token:
Enable and list secrets engines:
Everything works without manual unseal steps.

7. Confirm Auto-Unseal After Restart

Restart Vault again:
Vault remains unsealed thanks to AWS KMS auto-unseal, eliminating manual recovery.
Congratulations! You’ve successfully set up Cloud Auto Unseal with AWS KMS. This configuration streamlines your Vault operations and boosts security by removing manual unseal key handling.

Watch Video