Secrets manager
AWS Secrets Manager / SSM Parameter Store
Stores credentials (DB passwords, API keys) encrypted, with rotation and access control.
In a monolith
.env file
Secrets in environment variables or a config file on the server — easy, and easy to leak into git.
In a distributed system
Central secret store
Services fetch secrets at startup (or get them injected) with per-service permissions; rotation without redeploys.
On AWS
AWS Secrets Manager / SSM Parameter Store
Encrypted with KMS, IAM-scoped access, automatic rotation for RDS credentials; ECS and Lambda can inject secrets as environment variables.
- Secrets Manager$Rotation built in
- SSM Parameter Store (SecureString)$Cheaper, no built-in rotation
- Reach for it when
- More than one service or person needs credentials, or compliance requires rotation.
- What it costs you
- A startup dependency — cache secrets, never fetch per request
- Rotation needs apps that re-read credentials
- When it dies
- Running services keep their cached secrets; new instances may fail to start.
Interview follow-ups
How do you rotate a DB password without downtime?
Keep two valid credentials during rotation: create the new one, update the secret, let apps pick it up, then revoke the old one.