2026-09-13 · 11 min
Secrets Management in 2026: HashiCorp Vault vs AWS Secrets Manager, From Someone Who Runs Both
A leaked database password used to mean a 2 a.m. rotation, a frantic Slack thread, and hoping nobody dumped the table in the meantime. In 2026 there is no excuse for that, and the two tools most teams reach for are HashiCorp Vault and AWS Secrets Manager. I run both in production — Vault for a multi-cloud platform, Secrets Manager for a smaller all-AWS shop — and they are not interchangeable. This is the secrets management comparison I wish someone had handed me before I picked wrong the first time.
Let me be blunt up front: most teams asking “Vault or Secrets Manager?” are actually asking two different questions and don’t realize it. One is “how do I stop storing passwords in .env files committed to Git.” The other is “how do I make a stolen credential expire before an attacker can use it.” Those have very different answers.
The one distinction that decides everything: dynamic vs rotated secrets
Here is the mental model. AWS Secrets Manager rotates a secret. Vault generates one.
When Secrets Manager rotates your RDS password, the password still exists as a persistent user in the database. A Lambda changes it every 30 days. Between rotations, that credential is a long-lived, standing target. If it leaks on day 3, it’s valid for 27 more days.
Vault’s database secrets engine does something categorically different. Every time a service asks for database access, Vault runs CREATE USER on the fly, hands back a unique credential with a lease, and then runs DROP USER the moment that lease expires.
# Enable the database secrets engine and configure a Postgres connection
vault secrets enable database
vault write database/config/orders-db \
plugin_name=postgresql-database-plugin \
allowed_roles="orders-service" \
connection_url="postgresql://{{username}}:{{password}}@orders-db.internal:5432/orders?sslmode=require" \
username="vault_admin" \
password="$VAULT_ADMIN_PW"
# Define a role: this credential lives for 1 hour, renewable up to 24h
vault write database/roles/orders-service \
db_name=orders-db \
creation_statements="CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; \
GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO \"{{name}}\";" \
default_ttl="1h" \
max_ttl="24h"
Now the service reads a fresh credential per boot:
vault read database/creds/orders-service
# Key Value
# --- -----
# lease_id database/creds/orders-service/8vXY...
# lease_duration 1h
# username v-token-orders-s-9Kj2mQ...
# password A1a-8fh2...
A credential stolen from a compromised pod is worthless in 60 minutes, and you have a per-credential audit trail — you know exactly which lease touched the database. Secrets Manager cannot do this natively. That capability, more than anything else, is what you’re paying for when you take on the operational weight of Vault.
What AWS Secrets Manager does better: nothing to run
The flip side is real and I don’t want to undersell it. Secrets Manager has zero operational surface. There is no cluster to unseal, no Raft quorum to babysit, no upgrade cadence, no “who has the recovery keys” ceremony. You call an API, you get a secret, IAM decides who’s allowed.
import boto3
import json
client = boto3.client("secretsmanager", region_name="ap-southeast-3") # Jakarta
def get_db_secret(secret_id: str) -> dict:
resp = client.get_secret_value(SecretId=secret_id)
return json.loads(resp["SecretString"])
creds = get_db_secret("prod/orders/postgres")
Rotation is a checkbox plus a Lambda. IAM policies scope access down to individual secrets. It’s tagged, it’s in CloudTrail, it’s encrypted with KMS, and if you’re already all-in on AWS, it slots in with roughly a day of work. Enable rotation and pick a schedule:
aws secretsmanager rotate-secret \
--secret-id prod/orders/postgres \
--rotation-lambda-arn arn:aws:lambda:ap-southeast-3:1234:function:SecretsManagerRDSPostgreSQLRotation \
--rotation-rules '{"ScheduleExpression": "rate(30 days)"}'
I’ve watched a two-person startup near Alam Sutera — the ones renting a floor in that office tower on Jalan Alam Sutera Boulevard — try to stand up Vault “properly” and burn three weeks on it before they had a single secret stored. For a team that size, all-AWS, Secrets Manager was the correct answer and Vault was resume-driven development. Know which situation you’re in.
Cost, without the marketing gloss
Secrets Manager pricing in 2026: USD 0.40 per secret per month, plus USD 0.05 per 10,000 API calls.
Do the arithmetic before you commit. Three environments, ~1,000 secrets each, is 3,000 secrets — USD 1,200/month floor. A chatty service that fetches secrets on every cold start can push API costs higher than you’d guess. It’s cheap per unit and expensive in aggregate.
Vault Community Edition has no per-secret fee. Your bill is a 3-node HA cluster (Raft integrated storage means you no longer need a separate Consul cluster, which used to double the footprint), plus the salary line nobody puts in the comparison table: someone has to run it. Patching, unsealing after restarts, upgrade testing, backup of the storage backend, rotating the recovery keys.
The honest breakpoint: below a few hundred secrets in a single cloud, Secrets Manager is cheaper once you price your own hours. Above a few thousand secrets across multiple clouds, Vault’s unit economics win — but only because you already employ someone whose job includes running platform tooling. If you don’t, Vault isn’t cheaper, it’s just a cost you haven’t noticed yet.
Auth and the multi-cloud question
This is where Vault pulls ahead structurally. Secrets Manager authenticates one way: IAM. That’s elegant inside AWS and useless outside it. If your GCP workloads or on-prem boxes need secrets, Secrets Manager was never designed for them.
Vault speaks many auth methods — Kubernetes, AWS IAM, GCP, OIDC, AppRole, JWT — and hands them all a unified policy layer. A pod in EKS and a VM in GCP can authenticate to the same Vault and get scoped access under the same ACL model.
# A Vault policy: this identity may only read one dynamic DB role, nothing else
path "database/creds/orders-service" {
capabilities = ["read"]
}
path "secret/data/orders/*" {
capabilities = ["read"]
}
For Kubernetes specifically, don’t hand-roll secret fetching. In 2026 the Vault Secrets Operator (VSO) is the sane default — it reconciles Vault secrets into native K8s Secrets and handles rotation for you:
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultDynamicSecret
metadata:
name: orders-db-creds
namespace: orders
spec:
mount: database
path: creds/orders-service
destination:
name: orders-db-creds # materialized as a Kubernetes Secret
create: true
rolloutRestartTargets:
- kind: Deployment
name: orders-api # restart the deployment when the lease rotates
On the AWS side, the equivalent is the Secrets Store CSI driver with the AWS provider (ASCP), tied to your pods via EKS Pod Identity so there are no static keys anywhere. Both are fine. The point is: injection should be declarative infrastructure, not application code.
So which one
If you are entirely on AWS, have fewer than a few hundred secrets, and “stop putting passwords in Git and rotate the important ones” is the actual goal — use AWS Secrets Manager. Anything else is over-engineering, and I’ve watched teams pay for that mistake in weeks they’ll never get back.
If you are multi-cloud or hybrid, if a stolen credential surviving even one hour is unacceptable in your threat model, or if you genuinely need per-request dynamic credentials with automatic revocation — use HashiCorp Vault, and staff it like you mean it. Half-run Vault is worse than well-run Secrets Manager, because an unsealed-by-a-script, never-patched Vault cluster is a single point of failure holding every secret you own.
One thing neither vendor markets: the hardest part of secrets management was never the tool. It’s that your codebase already has forty places reading os.environ directly, and no amount of Vault or Secrets Manager fixes that until you refactor them. Pick the tool second. Audit where your secrets actually get read first — that’s the work that keeps the 2 a.m. rotation from happening again.
Ditulis oleh Reza Pradipta