Skip to Content
Asterrr's Handbook
Service cheat sheetsSecurity and identity cheat sheets

AWS Secrets Manager

Store, retrieve and rotate credentials with KMS encryption, staging labels and a deletion recovery window.

Legacy

Short cheat sheet. The full exam treatment is AWS Secrets Manager.

Secrets Manager stores secrets, encrypts them with KMS and rotates them on a schedule. Applications fetch the value at runtime instead of holding it in code. Secrets can replicate to other Regions.

GetSecretValuedecryptscheduleset new passwordApplicationSecretKMS keyRotationfunctionRDS database
A rotation Lambda writes the new credential, tests it, then promotes it. Applications always read the current version.

Core facts

ItemWhat to remember
RotationOn a schedule or on demand. Managed rotation needs no Lambda. Otherwise a Lambda rotation function does the work.
Staging labelsNew value gets AWSPENDING. After the test passes it becomes AWSCURRENT and the old one becomes AWSPREVIOUS.
EncryptionKMS. Uses the account default key unless you name a customer managed key.
NetworkRotation function in a VPC needs a NAT gateway or a Secrets Manager VPC endpoint to reach the service.
ReplicationCopies the secret and metadata to other Regions. You cannot delete a primary that still has replicas.
AccessIAM and resource policies. Tag-based access works. VPC endpoint keeps traffic private.
Master and user secretsA master secret can rotate the user credential so clients keep working during rotation.

Deletion

SettingValue
Recovery window7 to 30 days. Default 30.
During the windowSecret is inaccessible. RestoreSecret cancels the deletion.
No recovery--force-delete-without-recovery deletes immediately and permanently.
Detect useCloudWatch alarm on access attempts during the window.

Exam signal

"Rotate RDS credentials automatically and fetch them at runtime" is Secrets Manager.

Exam trap

A rotation Lambda inside a VPC with no NAT and no endpoint cannot reach Secrets Manager and rotation fails. A finished delete after the window cannot be undone.

KMS key types, Fargate

Further reading

On this page