All Products
Search
Document Center

Key Management Service:UpdateSecretRotationPolicy

Last Updated:Jul 29, 2025

Updates the rotation policy of a secret.

Operation description

After automatic rotation is enabled, Secrets Manager schedules the first automatic rotation by adding the preset rotation interval to the timestamp of the last rotation.

Limits: The UpdateSecretRotationPolicy operation cannot be used to update the rotation policy of generic secrets.

In this example, the rotation policy of the RdsSecret/Mysql5.4/MyCred secret is updated. The following settings are modified:

  • The EnableAutomaticRotation parameter is set to true, which indicates that automatic rotation is enabled.
  • The RotationInterval parameter is set to 30d, which indicates that the interval for automatic rotation is 30 days.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
SecretNamestringYes

The name of the secret.

RdsSecret/Mysql5.4/MyCred
EnableAutomaticRotationbooleanYes

Specifies whether to enable automatic rotation. Valid values:

  • true: enables automatic rotation.
  • false: does not enable automatic rotation. This is the default value.
true
RotationIntervalstringNo

The interval for automatic rotation. Valid values: 6 hours to 8,760 hours (365 days).

The value is in the integer[unit] format.````

The unit can be d (day), h (hour), m (minute), or s (second). For example, both 7d and 604800s indicate a seven-day interval.

Note This parameter is required if you set the EnableAutomaticRotation parameter to true. This parameter is ignored if you set the EnableAutomaticRotation parameter to false or does not specify the EnableAutomaticRotation parameter.
30d

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
SecretNamestring

The name of the secret.

RdsSecret/Mysql5.4/MyCred
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

2c124f6f-4210-499f-b88a-69f54004d2d8

Examples

Sample success responses

JSONformat

{
  "SecretName": "RdsSecret/Mysql5.4/MyCred",
  "RequestId": "2c124f6f-4210-499f-b88a-69f54004d2d8"
}

Error codes

For a list of error codes, visit the Service error codes.