Skip to main content

Overview

The Vault module creates AWS resources required for running HashiCorp Vault on EKS with KMS auto-unseal and DynamoDB as the storage backend. It configures IAM roles for IRSA (IAM Roles for Service Accounts) to allow Vault pods to access AWS services.

Features

KMS Auto-Unseal

AWS KMS key for automatic Vault unsealing on pod restart

DynamoDB Storage

Highly available DynamoDB table for Vault storage backend

IRSA Integration

IAM role for EKS service account with least privilege permissions

Key Rotation

Optional automatic KMS key rotation enabled by default

Point-in-Time Recovery

DynamoDB PITR enabled by default for data protection

Helm-Ready Config

Output configuration object for Vault Helm chart

Architecture

Usage Examples

Basic Configuration

Production Configuration

With EKS Module

Inputs

Outputs

Deploying Vault with Helm

Use the module outputs to configure Vault Helm chart:

Install Vault

Helm Values (vault-values.yaml)

Terraform-Generated Helm Values

Initializing Vault

Initialize and Unseal

Store the root token and unseal keys in a secure location (e.g., AWS Secrets Manager, 1Password). They cannot be recovered if lost.

Check Vault Status

Enable Secrets Engine

Kubernetes Authentication

Enable Kubernetes auth for applications:

External Secrets Operator Integration

Configure ESO to sync secrets from Vault:

ClusterSecretStore

ExternalSecret

Backup and Recovery

DynamoDB Backup

Point-in-Time Recovery (PITR):
  • Enabled by default via dynamodb_point_in_time_recovery = true
  • Allows restore to any point in the last 35 days
Manual Backup:

KMS Key Backup

KMS keys cannot be exported, but:
  • Key material is replicated across multiple AZs
  • Key rotation creates new key versions
  • Old versions remain available for decryption

Vault Data Export

Cost Considerations

  • KMS key: $1/month
  • API requests: $0.03 per 10,000 requests
  • Vault unsealing: ~1000 requests/day = ~$0.10/month
  • Total: ~$1.10/month
  • On-demand pricing (pay per request)
  • Typical Vault usage: ~$5-20/month
  • PITR: Additional 20% of table storage
  • Consider provisioned capacity for predictable workloads
  • 3 Vault pods @ 500m CPU, 1Gi memory
  • Runs on existing EKS node group (no additional compute cost)
  • Storage: ~1GB per pod for cache

Troubleshooting

Vault Pods Not Starting

Check IAM role:
Verify IRSA annotation:
Check pod logs:

Cannot Auto-Unseal

Test KMS access from pod:
Common issues:
  • IAM role missing kms:Decrypt permission
  • KMS key not in the same region as EKS
  • OIDC provider not configured correctly

DynamoDB Access Issues

Test DynamoDB access:
Check IAM permissions:

Vault Initialization Failed

Check seal status:
If sealed manually, unseal:
With KMS auto-unseal configured, manual unsealing should not be necessary.

Security Best Practices

Secure Root Token

Store root token in AWS Secrets Manager or a password manager. Revoke after initial setup.

Enable Audit Logging

Configure Vault audit logging to CloudWatch or S3 for compliance.

Restrict Network Access

Use NetworkPolicies to limit Vault access to authorized pods only.

Key Rotation

Enable KMS key rotation (enabled by default) for enhanced security.

Least Privilege IAM

IAM role has minimum permissions for KMS and DynamoDB access only.

Enable PITR

DynamoDB point-in-time recovery (enabled by default) protects against data loss.

EKS Module

Deploy EKS cluster for Vault

K8s Scheduler Secrets

Using Vault for secrets management

Infrastructure Guide

Complete deployment workflow

Dependencies

External Secrets Operator setup