How does AWS Secrets Manager rotation work under the hood?
IntermediateProductionSecrets Management Architecture
Answer
A rotation Lambda runs four steps, moving staging labels between versions:
createSecret: generate a new value asAWSPENDING.setSecret: apply it to the target (DB user password).testSecret: log in with the pending value.finishSecret: moveAWSCURRENTto the new version; the old becomesAWSPREVIOUS.
aws secretsmanager rotate-secret --secret-id prod/orders/db \
--rotation-rules '{"ScheduleExpression":"rate(30 days)"}'
For RDS, prefer --manage-master-user-password, which lets RDS and Secrets Manager handle the master password rotation without a custom Lambda.
More on Secrets Management Architecture
How would you design a secrets management architecture for a multi-cloud, multi-cluster company?AdvancedVault vs AWS Secrets Manager: how do you choose in production?IntermediateHow do you run Vault in production for high availability?AdvancedHow do you solve the "secret zero" problem?IntermediateHow do Vault dynamic database credentials work operationally, and what can go wrong?AdvancedHow do you rotate a secret without downtime?Intermediate