All Products
Search
Document Center

Cloud Config:Examples of resource change logs

Last Updated:Aug 31, 2023

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 that are used.

Examples

The following three snippets show sample resource change logs for the create, modify, and delete operations on resources:

  • Create a resource

    In single-account mode, you use an Alibaba Cloud 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 disk is created. The disk configuration before the disk is created is displayed as null. The values of the relationship and relationshipDiff parameters show that the disk does not have associated resources and no change records exist.

    {
        "configurationItems": [
            {
            "accountId": "120886317861****",
            "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"
            }
        ],
        "requestId": "c746a79d-c0b9-4584-bf41-a6a9f370ee71",
        "fileVersion": "1.0"
  • Modify a resource

    In single-account mode, you use an Alibaba Cloud 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 tag is added. The tag configuration of the bucket is displayed as null before the tag is added. A tag whose key is key1 is displayed in the tag configuration of the bucket after the tag is added.

    {
        "configurationItems": [
            {
            "accountId": "120886317861****",
            "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"
            }
        ],
        "requestId": "e2e88348-8ee4-4b3a-9908-0c815bd47718",
        "fileVersion": "1.0"
    }
  • Delete a resource

    In multi-account mode, 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 disk is deleted. The disk configuration after the disk is deleted is displayed as null. The values of the relationship and relationshipDiff parameters show that the disk does not have associated resources and no change records exist.

    {
        "configurationItems": [
            {
            "accountId": "100931896542****",
            "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"
            }
        ],
        "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.
  • Ordinary account: An ordinary account is an independent Alibaba Cloud account that is not added to a resource directory by using a management account.

  • Management account: A management account is an Alibaba Cloud account that is used to create a resource directory and manages all member accounts in the resource directory.

  • Member account: A member account is an Alibaba Cloud account that belongs to a resource directory.

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 indicates the details of each associated resource.

    For information about the Alibaba Cloud services and resource types supported by Cloud Config, see Alibaba Cloud services and resource types supported by Cloud Config.

  • If the current resource has no associated resources, the parameter is left 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 of the parameter varies based on the resource type and the parameter may be left empty.

  • If the value of the resourceType parameter is ACS::ECS::Instance, the resource is an ECS instance that is in 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 is not in a specific state. In this case, this parameter is left empty.

resourceId

The resource ID.

resourceName

The resource name.

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 Services that work with Resource Group.

  • If the resource type does not support resource groups, the parameter is left empty.

resourceType

The resource type. For more information about the resource types supported by Cloud Config, see Alibaba Cloud services and resource types supported by Cloud Config.

tags

The tags of the resource.

resourceEventType

The type of the resource change event. Valid values:

  • DISCOVERED: A resource is created.

  • MODIFY: A resource is modified.

  • REMOVE: A resource is deleted.