[ aws . secretsmanager ]
Disables automatic scheduled rotation and cancels the rotation of a secret if currently in progress.
To re-enable scheduled rotation, call RotateSecret with AutomaticallyRotateAfterDays
set to a value greater than 0. This immediately rotates your secret and then enables the automatic schedule.
Note
If you cancel a rotation while in progress, it can leave the VersionStage
labels in an unexpected state. Depending on the step of the rotation in progress, you might need to remove the staging label AWSPENDING
from the partially created version, specified by the VersionId
response value. You should also evaluate the partially rotated new version to see if it should be deleted, which you can do by removing all staging labels from the new version VersionStage
field.
To successfully start a rotation, the staging label AWSPENDING
must be in one of the following states:
Not attached to any version at all
Attached to the same version as the staging label AWSCURRENT
If the staging label AWSPENDING
attached to a different version than the version with AWSCURRENT
then the attempt to rotate fails.
Minimum permissions
To run this command, you must have the following permissions:
secretsmanager:CancelRotateSecret
Related operations
To configure rotation for a secret or to manually trigger a rotation, use RotateSecret .
To get the rotation configuration details for a secret, use DescribeSecret .
To list all of the currently available secrets, use ListSecrets .
To list all of the versions currently associated with a secret, use ListSecretVersionIds .
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
cancel-rotate-secret
--secret-id <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
--secret-id
(string)
Specifies the secret to cancel a rotation request. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
See ‘aws help’ for descriptions of global parameters.
To cancel scheduled rotation for a secret
The following example shows how to cancel rotation for a secret. The operation sets the RotationEnabled
field to false and cancels all scheduled rotations. To resume scheduled rotations, you must re-enable rotation by calling the rotate-secret
operation.
aws secretsmanager cancel-rotate-secret --secret-id MyTestDatabaseSecret
The output shows the following:
{
"ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
"Name": "MyTestDatabaseSecret"
}
ARN -> (string)
The ARN of the secret for which rotation was canceled.
Name -> (string)
The friendly name of the secret for which rotation was canceled.
VersionId -> (string)
The unique identifier of the version of the secret created during the rotation. This version might not be complete, and should be evaluated for possible deletion. At the very least, you should remove the
VersionStage
valueAWSPENDING
to enable this version to be deleted. Failing to clean up a cancelled rotation can block you from successfully starting future rotations.