Rotate the secret automatically every 30 days using a Lambda function

aws secretsmanager

  • Store, manage, and retrieve secrets.
    More information: <https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

aws secretsmanager rotate-secret --secret-id {{name_or_arn}} --rotation-lambda-arn {{arn_of_lambda_function}} --rotation-rules AutomaticallyAfterDays={{30}}

click the source code to copy install aws secretsmanager on any operating system with command-not-found.com