All Products
Search
Document Center

Key Management Service:Monitor the rotation of dynamic ECS secrets

Last Updated:Mar 31, 2026

Secrets Manager delivers rotation events for dynamic Elastic Compute Service (ECS) secrets to CloudMonitor. By querying these events and setting up event-triggered alert rules in the CloudMonitor console, you can receive alert notifications and automate event handling — for example, using Function Compute to automatically remediate failed rotations.

Prerequisites

Before you begin, ensure that you have access to the .

Query rotation events

  1. Log on to the CloudMonitor console.

  2. In the left-side navigation pane, choose Event Center > System Event.

  3. On the System Event page, click the Event Monitoring tab.

  4. Select Key Management Service from the All Products drop-down list. Specify the alert level, event name, and time range to filter results.

  5. Find the target event in the list and click Details in the rightmost column.

Create an event-triggered alert rule

  1. On the System Event page, click the Event-triggered Alert Rules tab, then click Create Alert Rule.

  2. In the Create/Modify Event-triggered Alert Rule panel, configure the following parameters and click OK.

ParameterDescription
Alert rule nameA name for the alert rule. For example: secrets_rotation_failed or secrets_rotation_success.
Product typeSelect Key Management Service (KMS).
Event typeControls which rotation outcomes trigger alerts. Select Exception to alert on failed rotations only, or Notification to alert on successful rotations only. Selecting both sends an alert for every rotation regardless of outcome. To monitor failures and successes separately, create two rules with different event types.
Event levelThe severity level of the event. Select CRITICAL for failed rotations or INFO for successful rotations.
Event nameThe event identifier to monitor. Select Secret:RotateSecret:Failure for failed rotations or Secret:RotateSecret:Success for successful rotations. Avoid selecting both values in the same rule — create separate rules at different alert levels based on the business impact of each outcome.
Keyword filteringFilters alert rules by keyword. Contains any of the keywords sends an alert if the rule contains any specified keyword. Does not contain any of the keywords sends an alert if none of the specified keywords are present.
SQL filterAn SQL statement to filter alert rules.
Resource rangeSelect All Resources to apply the rule to all resources. CloudMonitor sends alert notifications for the specified events across all resources.
Notification methodConfigures how alerts are delivered and how events are processed. For alert delivery, select a Contact Group and a notification method: Critical (phone call + text message + email + webhook), Warning (SMS + text message + webhook), or Info (email + webhook). For automated event handling, select Simple Message Queue (formerly MNS), Function Compute, URL Callback, or Log Service.
Mute forThe interval at which alert notifications are resent if the alert is not cleared.

Alert notification content

Alert notifications follow the format <Resource type>:<Operation>:<Result>. The event payload includes a content field with details specific to each rotation outcome.

Failed rotation: Secret:RotateSecret:Failure

Check the failureInfo field in content to identify the failure cause.

{
    "product": "KMS",
    "eventTime": "20180816T135935.689+0800",
    "level": "CRITICAL",
    "name": "Secret:RotateSecret:Failure",
    "regionId": "cn-hangzhou",
    "resourceId": "acs:kms:cn-hangzhou:188989715694****:secret/secretName",
    "status": "Failed",
    "content": {
        "eventId": "eventId",
        "secretName": "SecretName",
        "secretType": "ECS",
        "RotationEntityArn": "acs:kms:cn-hangzhou:188989715694****:secret/secretName",
        "rotationStatus": "Invalid",
        "rotationSubType": "Password",
        "failureInfo": {
            "errorCode": "Kms:ErrorCode",
            "errorMessage": "errorMessage"
        },
        "failureTime": "2012-03-12T05:55:36Z"
    },
    "ver": "1.0"
}

Key fields for failure events:

FieldTypeDescription
levelstringSeverity of the event. CRITICAL for failed rotations.
statusstringOverall status. Failed for failed rotations.
content.rotationStatusstringRotation state. Invalid indicates the rotation failed.
content.rotationSubTypestringThe credential subtype being rotated, for example Password.
content.failureInfo.errorCodestringThe error code that identifies the failure cause.
content.failureInfo.errorMessagestringA human-readable description of the failure.
content.failureTimestringThe timestamp when the rotation failed (ISO 8601).

Successful rotation: Secret:RotateSecret:Success

{
    "product": "KMS",
    "instanceName": "secretId",
    "level": "INFO",
    "name": "Secret:RotateSecret:Success",
    "regionId": "cn-hangzhou",
    "resourceId": "acs:kms:cn-hangzhou:188989715694****:secret/secretName",
    "status": "Normal",
    "content": {
        "eventId": "eventId",
        "secretName": "SecretName",
        "secretType": "ECS",
        "RotationEntityArn": "acs:kms:cn-hangzhou:188989715694****:secret/secretName",
        "rotationStatus": "Enabled",
        "secretSubType": "Password",
        "successTime": "2012-03-12T05:55:36Z"
    },
    "ver": "1.0"
}

Key fields for success events:

FieldTypeDescription
levelstringSeverity of the event. INFO for successful rotations.
statusstringOverall status. Normal for successful rotations.
content.rotationStatusstringRotation state. Enabled indicates the rotation succeeded.
content.secretSubTypestringThe credential subtype that was rotated, for example Password.
content.successTimestringThe timestamp when the rotation completed (ISO 8601).