This topic provides examples of resource change logs that are delivered to Object Storage Service (OSS) 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 disk named test_disk in Elastic Compute Service (ECS) in the China (Hohhot) region. In the following log, the configurationDiff parameter displays the disk configurations before and after the create operation. The disk configuration before the create operation is displayed as null. The relationship and relationshipDiff parameters show that the disk has no associated resources and no change is made to the resource relationship.
    {
        "configurationItems": [
            {
            "accountId": "120886317861****",
            "arn": "acs:ecs:cn-huhehaote:120886317861****:disk/d-hp33k7bzwqvtmjrs****",
            "availabilityZone": "cn-huhehaote-a",
            "regionId": "cn-huhehaote",
            "configuration": "{\"DetachedTime\":\"\",\"Category\":\"cloud_essd\",\"KMSKeyId\":\"\",\"Description\":\"test_disk\",\"ResourceGroupId\":\"\",\"Size\":40,\"Encrypted\":false,\"DeleteAutoSnapshot\":false,\"DiskChargeType\":\"PostPaid\",\"MultiAttach\":\"Disabled\",\"ExpiredTime\":\"2029-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\":\"hp33k7bzwqvtmjrs****\",\"CreationTime\":\"2021-08-25T06:32:40Z\",\"RegionId\":\"cn-huhehaote\",\"DiskId\":\"d-hp33k7bzwqvtmjrs****\"}",
            "configurationDiff": "{\"Status\":[null,\"Available\"],\"Category\":[null,\"cloud_essd\"],\"Description\":[null,\"test_disk\"],\"ZoneId\":[null,\"cn-huhehaote-a\"],\"Size\":[null,40],\"Encrypted\":[null,false],\"PerformanceLevel\":[null,\"PL1\"],\"DeleteAutoSnapshot\":[null,false],\"DeleteWithInstance\":[null,false],\"EnableAutomatedSnapshotPolicy\":[null,false],\"DiskChargeType\":[null,\"PostPaid\"],\"EnableAutoSnapshot\":[null,true],\"DiskName\":[null,\"test_disk\"],\"MultiAttach\":[null,\"Disabled\"],\"OperationLocks\":[null,{\"OperationLock\":[]}],\"Portable\":[null,true],\"Type\":[null,\"data\"],\"SerialNumber\":[null,\"hp33k7bzwqvtmjrs****\"],\"ExpiredTime\":[null,\"2029-09-08T16:00Z\"],\"CreationTime\":[null,\"2021-08-25T06:32:40Z\"],\"RegionId\":[null,\"cn-huhehaote\"],\"Tags\":[null,{\"Tag\":[]}],\"DiskId\":[null,\"d-hp33k7bzwqvtmjrs****\"]}",
            "relationship": "",
            "relationshipDiff": "{\"relationship_diff\":{\"relationship_add\":[],\"relationship_delete\":[]}}",
            "captureTime": 1629873195000,
            "resourceCreateTime": 1629873160000,
            "resourceStatus": "Available",
            "resourceId": "d-hp33k7bzwqvtmjrs****",
            "resourceName": "test_disk",
            "resourceGroupId": "rg-acfmw3ty5y7****",
            "resourceType": "ACS::ECS::Disk",
            "tags": "{}",
            "resourceEventType": "DISCOVERED",
            "configAggregators": ""
            }
        ],
        "requestId": "c746a79d-c0b9-4584-bf41-a6a9f370ee71",
        "fileVersion": "1.0"
  • Modify a resource
    For example, you use an ordinary account whose ID is 120886317861**** to add a tag to an OSS bucket named test_bucket in the China (Hangzhou) region. In the following log, the configurationDiff parameter displays the tag configurations of the bucket before and after the modify operation. The tag configuration of the bucket is displayed as null before the modify operation. A tag whose key is key1 is displayed in the tag configuration of the bucket after the modify operation.
    {
        "configurationItems": [
            {
            "accountId": "120886317861****",
            "arn": "acs:oss:cn-hangzhou:120886317861****:test_bucket",
            "availabilityZone": "",
            "regionId": "cn-hangzhou",
            "configuration": "{\"AccessControlList\":{\"Grant\":\"private\"},\"ServerSideEncryptionRule\":{\"SSEAlgorithm\":\"None\"},\"Comment\":\"\",\"CreationDate\":\"2021-08-10T07:49:53.000Z\",\"Owner\":{\"DisplayName\":\"120886317861****\",\"ID\":\"120886317861****\"},\"StorageClass\":\"Standard\",\"DataRedundancyType\":\"LRS\",\"AllowEmptyReferer\":\"true\",\"Name\":\"test_bucket\",\"BucketPolicy\":{\"LogPrefix\":\"\",\"LogBucket\":\"\"},\"TagSet\":{\"Tag\":[{\"Value\":\"\",\"Key\":\"key1\"}]},\"ExtranetEndpoint\":\"oss-cn-hangzhou.aliyuncs.com\",\"IntranetEndpoint\":\"oss-cn-hangzhou-internal.aliyuncs.com\",\"Location\":\"oss-cn-hangzhou\"}",
            "configurationDiff": "{\"TagSet\":[null,{\"Tag\":[{\"Value\":\"\",\"Key\":\"key1\"}]}]}",
            "relationship": "",
            "relationshipDiff": "",
            "captureTime": 1629949618000,
            "resourceCreateTime": 1628581793000,
            "resourceStatus": "",
            "resourceId": "test_bucket",
            "resourceName": "test_bucket",
            "resourceGroupId": "",
            "resourceType": "ACS::OSS::Bucket",
            "tags": "{\"key1\":[\"\"]}",
            "resourceEventType": "MODIFY",
            "configAggregators": ""
            }
        ],
        "requestId": "e2e88348-8ee4-4b3a-9908-0c815bd47718",
        "fileVersion": "1.0"
    }
  • Delete a resource
    For example, you use a management account whose ID is 100931896542**** to delete a disk named test01_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 and no change is made to the resource relationship.
    {
        "configurationItems": [
            {
            "accountId": "100931896542****",
            "arn": "acs:ecs:cn-huhehaote:100931896542****:disk/d-hp3ezlgii0ltupns****",
            "availabilityZone": "cn-huhehaote-a",
            "regionId": "cn-huhehaote",
            "configuration": "{\"DetachedTime\":\"\",\"Category\":\"cloud_essd\",\"KMSKeyId\":\"\",\"Description\":\"\",\"ResourceGroupId\":\"\",\"Size\":40,\"Encrypted\":false,\"DeleteAutoSnapshot\":false,\"DiskChargeType\":\"PostPaid\",\"MultiAttach\":\"Disabled\",\"ExpiredTime\":\"2029-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\":\"test01_disk\",\"BdfId\":\"\",\"OperationLocks\":{\"OperationLock\":[]},\"Portable\":true,\"Type\":\"data\",\"SerialNumber\":\"hp3ezlgii0ltupns****\",\"CreationTime\":\"2021-08-25T08:16:20Z\",\"RegionId\":\"cn-huhehaote\",\"DiskId\":\"d-hp3ezlgii0ltupns****\"}",
            "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\":[\"test01_disk\",null],\"MultiAttach\":[\"Disabled\",null],\"OperationLocks\":[{\"OperationLock\":[]},null],\"Portable\":[true,null],\"Type\":[\"data\",null],\"SerialNumber\":[\"hp3ezlgii0ltupns****\",null],\"ExpiredTime\":[\"2029-09-08T16:00Z\",null],\"CreationTime\":[\"2021-08-25T08:16:20Z\",null],\"RegionId\":[\"cn-huhehaote\",null],\"Tags\":[{\"Tag\":[]},null],\"DiskId\":[\"d-hp3ezlgii0ltupns****\",null]}",
            "relationship": "",
            "relationshipDiff": "{\"relationship_diff\":{\"relationship_add\":[],\"relationship_delete\":[]}}",
            "captureTime": 1629880000000,
            "resourceCreateTime": 1629879380000,
            "resourceStatus": "Available",
            "resourceId": "d-hp3ezlgii0ltupns****",
            "resourceName": "test01_disk",
            "resourceGroupId": "rg-acfmvoh45rh****",
            "resourceType": "ACS::ECS::Disk",
            "tags": "{}",
            "resourceEventType": "REMOVE",
            "configAggregators": "100931896542****:ca-08e6626622af0044****"
            }
        ],
        "requestId": "cbb047ba-1149-46d3-a07d-5ac20d94ba49",
        "fileVersion": "1.0"
    }

Parameters

The following table describes the parameters involved in resource change logs that are delivered to OSS.
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.
regionId The ID of the region where the resource resides.
configuration The current configuration of the resource.
configurationDiff The resource configurations before and after the change.
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.
captureTime The timestamp when Cloud Config detected the resource change event and generated the snapshot.
resourceCreateTime The timestamp when the resource was created.
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 OSS bucket that does not have a specific state. In this case, the value is empty.
resourceId The ID of the resource.
resourceName The name of the resource.
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.
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.
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.
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.