Skill 5.1.3
Manage secrets in infrastructure code (for example, by using AWS Secrets Manager, AWS Systems Manager Parameter Store).
Key Concepts
Move secrets to Secrets Manager (automatic rotation, cross-Region replication, resource policies) or Parameter Store SecureString; retrieve at run time with caching. Replace IAM user keys with roles, IAM Identity Center, and IAM Roles Anywhere for on-premises workloads.
Detect exposed credentials with GuardDuty, Amazon Inspector code scanning or repository secret scanning, and rotate them immediately.
In templates: CloudFormation dynamic references such as {{resolve:secretsmanager:prod/db:SecretString:password}} and {{resolve:ssm-secure:/app/key}} resolve values at deployment without storing them in the template or stack outputs; AWS::SecretsManager::Secret with GenerateSecretString creates a random secret, and RDS ManageMasterUserPassword lets RDS create and rotate the master password in Secrets Manager. In the CDK, secrets are referenced by ARN or name and permissions are granted with secret.grantRead().