This required configuration information includes the ARN of an AWS
Lambda function and the time between scheduled rotations. The Lambda
rotation function creates a new version of the secret and creates or
updates the credentials on the protected service to match. After testing
the new credentials, the function marks the new secret with the staging
label AWSCURRENT
so that your clients all immediately begin to use the
new version. For more information about rotating secrets and how to
configure a Lambda function to rotate the secrets for your protected
service, see Rotating Secrets in AWS Secrets Manager
in the AWS Secrets Manager User Guide.
Secrets Manager schedules the next rotation when the previous one is
complete. Secrets Manager schedules the date by adding the rotation
interval (number of days) to the actual date of the last rotation. The
service chooses the hour within that 24-hour date window randomly. The
minute is also chosen somewhat randomly, but weighted towards the top of
the hour and influenced by a variety of factors that help distribute
load.
The rotation function must end with the versions of the secret in one of
two states:
The AWSPENDING
and AWSCURRENT
staging labels are attached to the
same version of the secret, or
The AWSPENDING
staging label is not attached to any version of the
secret.
If instead the AWSPENDING
staging label is present but is not attached
to the same version as AWSCURRENT
then any later invocation of
RotateSecret
assumes that a previous rotation request is still in
progress and returns an error.
Minimum permissions
To run this command, you must have the following permissions:
Related operations
To list the secrets in your account, use ListSecrets.
To get the details for a version of a secret, use DescribeSecret.
To create a new version of a secret, use CreateSecret.
To attach staging labels to or remove staging labels from a version
of a secret, use UpdateSecretVersionStage.