Secrets Manager can deliver rotation events of dynamic ApsaraDB RDS secrets to CloudMonitor. You can query the rotation events and create event-triggered alert rules in the CloudMonitor console. This way, you can receive alert notifications for events and automate the event handling process.
Query rotation events
Create an event-triggered alert rule
You can create event-triggered alert rules to monitor the rotation of dynamic ApsaraDB RDS secrets and automate the event handling process. For example, you can monitor failed rotation of dynamic ApsaraDB RDS secrets and use Function Compute to automatically resolve the failure.
Alert notification content
An alert notification is in the
<Resource type>:<Operation that was performed on the resource>:<Result>
format. After you create an event-triggered alert rule for rotation events of dynamic
ApsaraDB RDS secrets, the system sends alert notifications based on the rotation result.
Secret:RotateSecret:Failure
: the failed rotation of dynamic ApsaraDB RDS secrets.You can view the information about rotation of dynamic ApsaraDB RDS secrets in thecontent
field of the event. The information includes theRotationEntityArn
field that indicates the ID of the ApsaraDB RDS instance associated with the secret and thefailureInfo
field that indicates the failure cause. Example:{ "product": "KMS", "eventTime": "20180816T135935.689+0800", "level": "CRITICAL", "name": "Secret:RotateSecret:Failure", "regionId": "cn-hangzhou", "resourceId": " acs:kms:cn-hangzhou:123456789:secret/secretId", "status": "Failed", "content": { "eventId": "eventId", "secretName": "SecretName", "secretType": "Rds", "RotationEntityArn": "acs:rds:$regionId:$accountId:dbinstance/$dbinstanceid", "rotationStatus": "Invalid", "rotationSubType": "SingleUser", "failureInfo": { "errorCode": "Kms:ErrorCode", "errorMessage": "errorMessage" }, "failureTime": "2012-03-12T05:55:36Z" }, "ver": "1.0" }
Secret:RotateSecret:Success
: the successful rotation of dynamic ApsaraDB RDS secrets.Example:
{ "product":"KMS", "instanceName":"secretId", "level":"INFO", "name":"Secret:RotateSecret:Success", "regionId":"cn-hangzhou", "resourceId":" acs:kms:cn-hangzhou:123456789:secret/secretId", "status":"Normal", "content":{ "eventId": "eventId", "secretName": "SecretName", "secretType": "Rds", "RotationEntityArn": "acs:rds:$regionId:$accountId:dbinstance/$dbinstanceid", "rotationStatus": "Enabled", "secretSubType": "SingleUser", "successTime": "2012-03-12T05:55:36Z" }, "ver":"1.0" }