Forrest logo
back to the aws tool

aws-secretsmanager:tldr:c047c

aws-secretsmanager: Rotate the secret automatically every 30 days using a Lambda function.
$ aws secretsmanager rotate-secret --secret-id ${name_or_arn} --rotation-lambda-arn ${arn_of_lambda_function} --rotation-rules AutomaticallyAfterDays=${30}
try on your machine

This command is used to configure automatic rotation for a secret in AWS Secrets Manager. Here is the explanation of each parameter:

  • aws secretsmanager rotate-secret: This is the main AWS CLI command to rotate a secret in AWS Secrets Manager.
  • --secret-id ${name_or_arn}: It specifies the ARN (Amazon Resource Name) or name of the secret that you want to rotate.
  • --rotation-lambda-arn ${arn_of_lambda_function}: It specifies the ARN of the AWS Lambda function that handles the rotation for the secret. This Lambda function should contain the logic to generate a new secret value and update it in the secret manager.
  • --rotation-rules AutomaticallyAfterDays=${30}: It sets the rotation rules for the secret. In this case, it states that the secret should be rotated automatically after 30 days. This means that the AWS Secrets Manager will invoke the specified Lambda function to rotate the secret every 30 days.

By specifying these parameters, the command configures automatic rotation for the specified secret using the specified Lambda function, with a rotation interval of 30 days.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the aws tool