Table of Contents
- Scenario
- Attempt to Start Vault
- Inspect Journal Logs
- Vault Configuration
- Attach IAM Role and Restart Vault
- Verify via Journal
- Initialize and Unseal Vault
- Common Errors & Resolutions
- References
Scenario
You have deployed a Vault server on AWS EC2. All configurations are in place, but the instance lacks an IAM role, so Vault cannot access the AWS KMS key for auto-unsealing.1. Attempt to Start Vault
Run:2. Inspect Journal Logs
Query Vault’s journal entries:NoCredentialProviders—it can’t find IAM credentials to access the KMS key.
Missing IAM permissions is the most common cause of AWS KMS seal failures. You can also provide AWS credentials via environment variables (
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY), but using an IAM role is recommended.3. Vault Configuration
Relevant snippet from/etc/vault.d/vault.hcl:
4. Attach IAM Role and Restart Vault
- In the AWS Console, navigate to EC2 → Instances and select your Vault instance.
- Choose Actions → Security → Modify IAM Role, and attach a role (e.g.,
VaultAutoUnseal) withkms:Decryptandkms:GenerateDataKeypermissions. - Restart Vault:
5. Verify via Journal
Tail the latest logs to confirm successful boot:6. Initialize and Unseal Vault
Set the Vault address:Never commit unseal keys or the root token to source control. Use a secure secret-management workflow.