This topic provides an example of the compliance snapshots that are delivered to a Simple Log Service (SLS). The following sections describe the content of the example and the parameters involved.
Example
In single-account mode, you use an Alibaba Cloud account whose ID is 100931896542***** and you have an instance iZ2ze3xqpgsk89p5zxhf**** in Elastic Compute Service (ECS) in the China (Heyuan) region. The compliance snapshots are delivered to a SLS. The following code shows a sample snapshot:
{
"annotation": "{\"configuration\":\"{}\",\"desiredValue\":\"{\\\"aaaaa\\\":\\\"\\\"}\",\"operator\":\"TagsExist\",\"property\":\"$.Tags\",\"reason\":\"Tags not match key: aaaaa\"}",
"resourceId": "i-f8z9iqwukcuzbgzxfl****",
"configRuleName": "ECS instance status is not stopped",
"riskLevel": "Critical",
"configRuleId": "cr-d670626622af0086****",
"dataType": "CompliantSnapshot",
"resourceName": "Zf8z9iqwukcuzbgzxflcbZ",
"invokingEventMessageType": "Manual",
"complianceType": "COMPLIANT",
"accountId": "100931896542****",
"compliancePackId": "cp-d670626622af0086****",
"regionId": "cn-heyuan",
"requestId": "909c765c-e4da-4bc1-8690-1d93820f****",
"tags": "{\"acs:tag:createdby\":[\"customer:100931896542****\"],\"test\":[\"\"]}",
"resourceOwnerId": "100931896542****",
"lastNonCompliantRecordTimestamp": "1748227701804",
"resourceType": "ACS::ECS::Instance"
}Parameters
The following table describes the parameters involved in the compliance snapshots that are delivered to a SLS.
Parameter | Description |
annotation | The description of the resource compliance results. |
resourceId | The resource ID. |
configRuleName | The rule name. |
riskLevel | The risk level of the resources that do not comply with the rule. Valid values:
|
configRuleId | The rule ID. |
dataType | The type of the log received by SLS. Valid values:
|
resourceName | The name of the resource. |
invokingEventMessageType | The trigger type of the rule. Valid values:
|
complianceType | The compliance evaluation result of the resource. Valid values:
|
accountId | The ID of the account to which the resource belongs. The account ID depends on the account mode.
|
compliancePackId | The ID of the compliance package. |
regionId | The ID of the region where the resource resides. |
resourceOwnerId | The ID of the account to which the resource belongs. |
resourceType | The type of the resource. |
tags | The tags of the resource. |
lastNonCompliantRecordTimestamp | The start time of the last non-compliant resource. |