This topic provides examples of resource change logs that are delivered to Log Service for storage. The following sections describe the content of the examples and the parameters involved.

Examples

The following three pieces of code show sample resource change logs for the create, modify, and delete operations on resources:
  • Create a resource
    For example, you use an ordinary account whose ID is 120886317861**** to create a snapshot named test_snapshot in Elastic Compute Service (ECS) in the China (Hohhot) region. In the following log, the configurationDiff parameter displays the snapshot configurations before and after the create operation. The snapshot configuration before the create operation is displayed as null. The relationship and relationshipDiff parameters show that a resource whose ID is d-hp322ngh3vaawgm5**** is associated with the snapshot.
    accountId:120886317861****
    arn:
    availabilityZone:
    captureTime:1630422010000
    configAggregators:
    configuration:{"Status":"progressing","Usage":"none","Progress":"0%","Category":"standard","KMSKeyId":"","Description":"","ProductCode":"","Encrypted":false,"RetentionDays":30,"SnapshotName":"test_snapshot","SourceDiskId":"d-hp322ngh3vaawgm5****","SourceStorageType":"disk","SnapshotId":"s-hp37dkrirxjfr6wc****","SnapshotSN":"63879-24509308-566****","SourceDiskSize":100,"CreationTime":"2021-08-31T15:00:00Z","LastModifiedTime":"2021-08-31T15:00:00Z","SnapshotType":"timer","RemainTime":-1,"SourceDiskType":"data","Tags":{"Tag":[]}}
    configurationDiff:{"Status":[null,"progressing"],"Usage":[null,"none"],"Progress":[null,"0%"],"Category":[null,"standard"],"Encrypted":[null,false],"RetentionDays":[null,30],"SnapshotName":[null,"test_snapshot"],"SourceDiskId":[null,"d-hp322ngh3vaawgm5****"],"SourceStorageType":[null,"disk"],"SnapshotId":[null,"s-hp37dkrirxjfr6wc****"],"SnapshotSN":[null,"63879-24509308-566****"],"SourceDiskSize":[null,100],"CreationTime":[null,"2021-08-31T15:00:00Z"],"LastModifiedTime":[null,"2021-08-31T15:00:00Z"],"SnapshotType":[null,"timer"],"RemainTime":[null,-1],"SourceDiskType":[null,"data"],"Tags":[null,{"Tag":[]}]}
    dataType:ConfigurationItemChangeNotification
    regionId:cn-huhehaote
    relationship:[{"regionId":"cn-huhehaote","relationType":"IsAttachedTo","resourceId":"d-hp322ngh3vaawgm5****","resourceType":"ACS::ECS::Disk"}]
    relationshipDiff:{"relationship_diff":{"relationship_add":[{"regionId":"cn-huhehaote","relationType":"IsAttachedTo","resourceId":"d-hp322ngh3vaawgm5****","resourceType":"ACS::ECS::Disk"}],"relationship_delete":[]}}
    requestId:1539bfe4-fb24-4335-892f-b71ed15dac8b
    resourceCreateTime:1630422000000
    resourceEventType:DISCOVERED
    resourceGroupId:rg-acfmw3ty5y7****
    resourceId:s-hp37dkrirxjfr6wc****
    resourceName:test_snapshot
    resourceStatus:progressing
    resourceType:ACS::ECS::Snapshot
    tags:{}
  • Modify a resource
    For example, you use an ordinary account whose ID is 120886317861**** to add the key1 tag to a snapshot named test_snapshot in ECS in the China (Hohhot) region. In the following log, the configurationDiff parameter displays the tag configurations of the snapshot before and after the modify operation. The tag configuration of the snapshot is displayed as null before the modify operation. A tag whose key is key1 is displayed in the tag configuration of the snapshot after the modify operation. The relationship and relationshipDiff parameters show that a resource whose ID is d-hp322ngh3vaawgm5**** is disassociated from the snapshot.
    accountId:120886317861****
    arn:
    availabilityZone:
    captureTime:1630422042000
    configAggregators:
    configuration:{"Status":"progressing","Usage":"none","Progress":"0%","Category":"standard","KMSKeyId":"","Description":"","ProductCode":"","Encrypted":false,"RetentionDays":30,"SnapshotName":"test_snapshot","SourceDiskId":"d-hp322ngh3vaawgm5****","SourceStorageType":"disk","SnapshotId":"s-hp37dkrirxjfr6wc****","SnapshotSN":"63879-24509308-566****","SourceDiskSize":100,"CreationTime":"2021-08-31T15:00:00Z","LastModifiedTime":"2021-08-31T15:00:00Z","SnapshotType":"timer","RemainTime":-1,"SourceDiskType":"data","Tags":{"Tag":[{"TagKey":"key1","TagValue":""}]}}
    configurationDiff:{"Tags":[{"Tag":[]},{"Tag":[{"TagKey":"key1","TagValue":""}]}]}
    dataType:ConfigurationItemChangeNotification
    regionId:cn-huhehaote
    relationship:[{"regionId":"cn-huhehaote","relationType":"IsAttachedTo","resourceId":"d-hp322ngh3vaawgm5****","resourceType":"ACS::ECS::Disk"}]
    relationshipDiff:{"relationship_diff":{"relationship_add":[],"relationship_delete":[]}}
    requestId:faa8df6c-7dd2-476f-a246-c4b1ea055c21
    resourceCreateTime:1630422000000
    resourceEventType:MODIFY
    resourceGroupId:rg-acfmw3ty5y7****
    resourceId:s-hp37dkrirxjfr6wc****
    resourceName:test_snapshot
    resourceStatus:progressing
    resourceType:ACS::ECS::Snapshot
    tags:{"key1":[""]}
  • Delete a resource
    For example, you use an ordinary account whose ID is 120886317861**** to delete a disk named test_disk from ECS in the China (Hohhot) region. In the following log, the configurationDiff parameter displays the disk configurations before and after the delete operation. The disk configuration after the delete operation is displayed as null. The relationship and relationshipDiff parameters show that the disk has no associated resources.
    accountId:120886317861****
    arn:acs:ecs:cn-huhehaote:120886317861****:disk/d-hp33mwzuof9qoa22****
    availabilityZone:cn-huhehaote-a
    captureTime:1629875147000
    configAggregators:
    configuration:{"DetachedTime":"","Category":"cloud_essd","KMSKeyId":"","Description":"","ResourceGroupId":"","Size":40,"Encrypted":false,"DeleteAutoSnapshot":false,"DiskChargeType":"PostPaid","MultiAttach":"Disabled","ExpiredTime":"2999-09-08T16:00Z","ImageId":"","StorageSetId":"","Tags":{"Tag":[]},"Status":"Available","AttachedTime":"","StorageClusterId":"","ZoneId":"cn-huhehaote-a","InstanceId":"","ProductCode":"","SourceSnapshotId":"","Device":"","PerformanceLevel":"PL1","DeleteWithInstance":false,"EnableAutomatedSnapshotPolicy":false,"EnableAutoSnapshot":true,"AutoSnapshotPolicyId":"","DiskName":"test_disk","BdfId":"","OperationLocks":{"OperationLock":[]},"Portable":true,"Type":"data","SerialNumber":"hp33mwzuof9qoa22****","CreationTime":"2021-08-25T06:52:35Z","RegionId":"cn-huhehaote","DiskId":"d-hp33mwzuof9qoa22****"}
    configurationDiff:{"Status":["Available",null],"Category":["cloud_essd",null],"ZoneId":["cn-huhehaote-a",null],"Size":[40,null],"Encrypted":[false,null],"PerformanceLevel":["PL1",null],"DeleteAutoSnapshot":[false,null],"DeleteWithInstance":[false,null],"EnableAutomatedSnapshotPolicy":[false,null],"DiskChargeType":["PostPaid",null],"EnableAutoSnapshot":[true,null],"DiskName":["test_disk",null],"MultiAttach":["Disabled",null],"OperationLocks":[{"OperationLock":[]},null],"Portable":[true,null],"Type":["data",null],"SerialNumber":["hp33mwzuof9qoa22ic6q",null],"ExpiredTime":["2999-09-08T16:00Z",null],"CreationTime":["2021-08-25T06:52:35Z",null],"RegionId":["cn-huhehaote",null],"Tags":[{"Tag":[]},null],"DiskId":["d-hp33mwzuof9qoa22****",null]}
    dataType:ConfigurationItemChangeNotification
    regionId:cn-huhehaote
    relationship:
    relationshipDiff:{"relationship_diff":{"relationship_add":[],"relationship_delete":[]}}
    requestId:d9bca2bc-75ba-4e4c-92dd-7cc38e779806
    resourceCreateTime:1629874355000
    resourceEventType:REMOVE
    resourceGroupId:rg-acfmw3ty5y7****
    resourceId:d-hp33mwzuof9qoa22****
    resourceName:test_disk
    resourceStatus:Available
    resourceType:ACS::ECS::Disk
    tags:{}

Parameters

The following table describes the parameters involved in resource change logs that are delivered to Log Service.
Parameter Description
accountId The ID of the account to which the resource belongs. Cloud Config supports the following types of accounts:
  • Ordinary account: An ordinary account is an independent Alibaba Cloud account that is not included in a resource directory by a management account.
  • Management account: A management account is an Alibaba Cloud account that enables a resource directory and manages all member accounts.
  • Member account: A member account is an Alibaba Cloud account in a resource directory.
arn The Alibaba Cloud Resource Name (ARN) of the resource. For more information about the ARN formats of different Alibaba Cloud services, see Types of resources that support Tag API operations.
availabilityZone The zone where the resource resides.
captureTime The timestamp when Cloud Config detected the resource change and generated the log.
configAggregators The information about the account group, including the ID of the management account that created the account group and the ID of the account group. The value varies with the type of the account to which the resource belongs.
  • If the resource belongs to an ordinary account, the value is empty.
  • If the resource belongs to a management account, the information about the account group created by the management account is displayed.
  • If the resource belongs to a member account, the information about the relevant account group is displayed. The relevant account group is created by the management account to which the member account belongs.
configuration The current configuration of the resource,
configurationDiff The resource configurations before and after the change.
dataType The type of the log received by Log Service. Valid values:
  • ConfigurationItemChangeNotification: resource change log
  • NonCompliantNotification: resource non-compliance event
regionId The ID of the region where the resource resides.
relationship The details of each resource that is associated with the current resource, including the region ID, resource relationship, resource ID, and resource type. This parameter is available only if the current resource has associated resources.
  • If the current resource has associated resources, the value is the details of each associated resource.

    For more information about the resource relationships supported by Cloud Config, see Alibaba Cloud services that support Cloud Config.

  • If the current resource has no associated resources, the value is empty.
relationshipDiff The change records of the resource relationship.
resourceCreateTime The timestamp when the resource was created.
resourceEventType The type of the resource change event involved. Valid values:
  • DISCOVERED: A resource is created.
  • MODIFY: A resource is modified.
  • REMOVE: A resource is deleted.
resourceGroupId The ID of the resource group to which the resource belongs. This parameter is available only if the resource type supports resource groups.
  • If the resource type supports resource groups, the value is the ID of the resource group to which the resource belongs.

    For more information about the Alibaba Cloud services and resource types that support resource groups, see Alibaba Cloud services that support resource groups.

  • If the resource type does not support resource groups, the value is empty.
resourceId The ID of the resource.
resourceName The name of the resource.
resourceStatus The status of the resource. The value varies with the resource type and may be left empty. Examples:
  • If the value of the resourceType parameter is ACS::ECS::Instance, the resource is an ECS instance that has a specific state. In this case, valid values of this parameter are Running and Stopped.
  • If the value of the resourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that does not have a specific state. In this case, the value is empty.
resourceType The resource type. For more information about the resource types supported by Cloud Config, see Alibaba Cloud services that support Cloud Config.
tags The tags of the resource.