What is Secrets Manager?
A safe place for passwords, API keys, and tokens, with access control, auditing, and automatic rotation.
Every app has secrets: database passwords, third-party API keys, OAuth client secrets. Common bad places to keep them:
- Hard-coded in source code (and pushed to GitHub, where bots find them in minutes)
- Plain-text config files copied between servers
- Environment variables anyone with console access can read
AWS Secrets Manager stores secrets encrypted, controls who can read each one with IAM, logs every access in CloudTrail, and can rotate them automatically.
Secrets Manager is a bank's safe-deposit box. Only people on the list can open it, every visit is logged, and the bank can change the lock on a schedule without you having to collect new keys from everyone.
In our project
NoteSnap uses a third-party email API. Its API key lives in Secrets Manager, and the Lambda function reads it at startup using its IAM role. The key never appears in code or config.
Key takeaways
- Never keep secrets in code, config files, or plain environment variables.
- Secrets Manager encrypts secrets, controls access with IAM, and logs every read.
- It can rotate secrets automatically.
Check your understanding
Pick an answer to see the explanation.
1. Where should a production database password live?