All Products
Search
Document Center

Key Management Service:UpdateSecretRotationPolicy

Last Updated:Aug 28, 2026

Updates the automatic 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: This 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 with the following settings:

  • The EnableAutomaticRotation parameter is set to true to enable automatic rotation.

  • The RotationInterval parameter is set to 30d to specify a 30-day rotation interval.

For more information about the required access policy for a RAM user or RAM role, see Resource Access Management.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

SecretName

string

Yes

The name of the secret.

RdsSecret/Mysql5.4/MyCred

EnableAutomaticRotation

boolean

Yes

Specifies whether to enable automatic rotation. Valid values:

  • true: enables automatic rotation.

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

true

RotationInterval

string

No

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 EnableAutomaticRotation is set to true. This parameter is ignored if EnableAutomaticRotation is set to false or is not specified.

30d

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

Response elements

Element

Type

Description

Example

object

SecretName

string

The name of the secret.

RdsSecret/Mysql5.4/MyCred

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.