Set up automatic secret rotation in AWS Secrets Manager

domain: docs.aws.amazon.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create or import the secret in Secrets Manager, choosing the secret type that matches your resource (e.g., RDS credentials)
  2. Create a Lambda rotation function using the AWS-provided rotation function template for your database engine, or author one implementing the four lifecycle steps: createSecret, setSecret, testSecret, and finishSecret
  3. Grant the Lambda execution role permissions to call secretsmanager:GetSecretValue, secretsmanager:PutSecretValue, secretsmanager:UpdateSecretVersionStage, and secretsmanager:DescribeSecret on the target secret
  4. Configure the secret's rotation schedule in the console or via CLI, specifying the rotation interval and the Lambda function ARN; Secrets Manager will invoke the function on schedule
  5. In your application, always retrieve credentials by calling GetSecretValue at connection time (with a short in-process cache); do not bake credentials into environment variables or config files
  6. Test the rotation manually by calling rotate-secret via the CLI and verifying your application can still connect after the rotation completes

Known gotchas

Related routes

Configure automatic key rotation in AWS KMS and Azure Key Vault and manage the rotation lifecycle
docs.aws.amazon.com · 6 steps · unrated
Set up Amazon SES domain identity and Easy DKIM with automatic key rotation
docs.aws.amazon.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans