Skip to main content
In this guide, you’ll learn how to start a Vault server locally, initialize it with Raft storage, configure AWS KMS for auto-unseal, migrate from Shamir sealing to AWS KMS, and validate the auto-unseal workflow. This is ideal for test environments and hands-on practice toward certification.
  • Vault v1.10.0-ent or later
  • AWS CLI v2 configured with sufficient IAM permissions
  • A customer-managed AWS KMS key in the desired region
  • Basic knowledge of Vault CLI and AWS IAM

Table of Contents

  1. Initial Vault Configuration
  2. Start Vault Server
  3. Initialize & Unseal Vault
  4. Enable KV Secrets Engine
  5. Configure AWS KMS Auto-Unseal
  6. Grant AWS IAM Permissions
  7. Set AWS Credentials
  8. Restart & Migrate Seal
  9. Validate Auto-Unseal

1. Initial Vault Configuration

Create a vault.hcl with Raft storage and default Shamir sealing (no seal stanza yet):

2. Start Vault Server

Launch Vault with the above configuration:
Look for:
In a new shell, set:

3. Initialize & Unseal Vault

  1. Check status:
    Expected output:
  2. Initialize Vault with 1 key share and threshold:
    Save the Unseal Key and Initial Root Token.
  3. Unseal Vault:
  4. Login:
  5. Verify unseal:

4. Enable KV Secrets Engine

Enable the KV (Key/Value) secrets engine and add a sample secret:

5. Configure AWS KMS Auto-Unseal

Edit vault.hcl to include the seal stanza for AWS KMS:

5.1 Retrieve KMS Key ARN

In the AWS KMS console, copy your customer-managed key ARN:
The image shows an AWS Key Management Service (KMS) console screen displaying details of a customer-managed key, including its general configuration and key administrators. The background features various logos and icons.

6. Grant AWS IAM Permissions

Create an IAM user with programmatic access and attach a policy allowing Vault to use the KMS key.
The image shows a web page from the AWS Management Console where a user is being added. It includes fields for setting user details and selecting AWS access types.
The image shows an AWS IAM Management Console screen where a user is being added, with options to set permissions by attaching existing policies directly. The background features various tech-related logos.
Example IAM policy:

7. Set AWS Credentials

In your shell, export the IAM user credentials and region:

Perform seal migration only in a non-production environment first. Ensure you have backups of your unseal keys before proceeding.

8. Restart & Migrate Seal

  1. Stop the Vault process (Ctrl+C).
  2. Restart with the updated vault.hcl:
  3. You’ll see:
  4. Migrate the seal:
    Successful output:

9. Validate Auto-Unseal

  1. Stop and start Vault again:
  2. Look for:
  3. Confirm seal type:
    The Seal Type should be awskms and Sealed should be false.

You have now configured Vault with AWS KMS auto-unseal, migrated from Shamir, and verified the process. For more details, see:

Watch Video

Practice Lab