Forrest logo
back to the aws tool

aws-secretsmanager:tldr:feb24

aws-secretsmanager: Rotate the secret immediately using a Lambda function.
$ aws secretsmanager rotate-secret --secret-id ${name_or_arn} --rotation-lambda-arn ${arn_of_lambda_function}
try on your machine

This command is used to manually initiate the rotation of a secret in AWS Secrets Manager. Here's a breakdown of the command:

  • aws secretsmanager rotate-secret: This is the AWS CLI command to rotate a secret in AWS Secrets Manager.
  • --secret-id ${name_or_arn}: This option specifies the identifier or Amazon Resource Name (ARN) of the secret that needs to be rotated. You need to replace ${name_or_arn} with the actual name or ARN of the secret.
  • --rotation-lambda-arn ${arn_of_lambda_function}: This option specifies the ARN of the Lambda function responsible for the secret rotation. You need to replace ${arn_of_lambda_function} with the actual ARN of the Lambda function.

By executing this command, you trigger the secret rotation process for the specified secret using the provided Lambda function. The Lambda function should contain the code/logic to rotate the secret, such as generating a new value and updating the secret in Secrets Manager.

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