资源配置变更历史内容示例

通过本文您可以了解配置审计的资源配置变更历史投递到日志服务SLS的内容示例和主要参数说明。

内容示例

创建资源、修改资源和删除资源的配置变更历史投递到日志服务SLS的内容示例如下:

  • 创建资源

    在单账号模式下,阿里云账号100931896542****在云服务器ECS的河源地域创建云盘test_disk,在configurationDiff中显示云盘的变更前信息null和变更后详细信息,在relationshiprelationshipDiff中显示云盘新增相关资源d-f8zcofij6pjsju50****。

    {
      "resourceId": "i-f8z8psx67rksgpp3lb****",
      "captureTime": "1748923229001",
      "configuration": "{\"ResourceGroupId\":\"\",\"Memory\":2048,\"InstanceChargeType\":\"PostPaid\",\"Cpu\":2,\"OSName\":\"Alibaba Cloud Linux  3.2104 LTS 64位\",\"InstanceNetworkType\":\"vpc\",\"InnerIpAddress\":{\"IpAddress\":[]},\"ExpiredTime\":\"2099-12-31T15:59Z\",\"ImageId\":\"aliyun_3_x64_20G_alibase_20250117.vhd\",\"EipAddress\":{\"AllocationId\":\"\",\"IpAddress\":\"\",\"InternetChargeType\":\"\"},\"ImageOptions\":{},\"VlanId\":\"\",\"HostName\":\"iZf8z8psx67rksgpp3lb6lZ\",\"Status\":\"Running\",\"AdditionalInfo\":{},\"HibernationOptions\":{\"Configured\":false},\"MetadataOptions\":{\"HttpTokens\":\"\",\"HttpEndpoint\":\"\"},\"InstanceId\":\"i-f8z8psx67rksgpp3lb****\",\"StoppedMode\":\"Not-applicable\",\"CpuOptions\":{\"ThreadsPerCore\":2,\"Numa\":\"ON\",\"CoreCount\":1},\"StartTime\":\"2025-06-03T03:58Z\",\"PrivateDnsNameOptions\":{},\"DeletionProtection\":false,\"VpcAttributes\":{\"PrivateIpAddress\":{\"IpAddress\":[\"172.28.129.241\"]},\"VpcId\":\"vpc-f8zhnrviismi44amovhi3\",\"VSwitchId\":\"vsw-f8zon645srm3g3xp33t****\",\"NatIpAddress\":\"\"},\"SecurityGroupIds\":{\"SecurityGroupId\":[\"sg-f8z41uaptndu6rj4d0b8\"]},\"InternetChargeType\":\"PayByTraffic\",\"InstanceName\":\"launch-advisor-20250603\",\"DeploymentSetId\":\"\",\"InternetMaxBandwidthOut\":5,\"SerialNumber\":\"b01f12d7-5308-427d-bd6e-af7601a05e****\",\"OSType\":\"linux\",\"CreationTime\":\"2025-06-03T03:58Z\",\"AutoReleaseTime\":\"2025-06-03T07:00Z\",\"Description\":\"测试SLS投递字段\",\"InstanceTypeFamily\":\"ecs.e\",\"DedicatedInstanceAttribute\":{\"Tenancy\":\"\",\"Affinity\":\"\"},\"PublicIpAddress\":{\"IpAddress\":[\"8.155.XX.XXX\"]},\"GPUSpec\":\"\",\"NetworkInterfaces\":{\"NetworkInterface\":[{\"Type\":\"Primary\",\"PrimaryIpAddress\":\"172.28.129.241\",\"MacAddress\":\"00:16:3e:18:cd:88\",\"NetworkInterfaceId\":\"eni-f8z8psx67rksgpp522lu\",\"PrivateIpSets\":{\"PrivateIpSet\":[{\"PrivateIpAddress\":\"172.28.129.241\",\"Primary\":true}]}}]},\"SpotPriceLimit\":0.0,\"SaleCycle\":\"\",\"DeviceAvailable\":true,\"InstanceType\":\"ecs.e-c1m1.large\",\"OSNameEn\":\"Alibaba Cloud Linux  3.2104 LTS 64 bit\",\"SpotStrategy\":\"NoSpot\",\"IoOptimized\":true,\"ZoneId\":\"cn-heyuan-a\",\"ClusterId\":\"\",\"EcsCapacityReservationAttr\":{\"CapacityReservationPreference\":\"\",\"CapacityReservationId\":\"\"},\"DedicatedHostAttribute\":{\"DedicatedHostId\":\"\",\"DedicatedHostName\":\"\",\"DedicatedHostClusterId\":\"\"},\"GPUAmount\":0,\"OperationLocks\":{\"LockReason\":[]},\"InternetMaxBandwidthIn\":200,\"Recyclable\":false,\"RegionId\":\"cn-heyuan\",\"CreditSpecification\":\"\"}",
      "availabilityZone": "cn-heyuan-a",
      "requestId": "0aece286-5291-491f-8ab8-bfc0921bd****",
      "resourceGroupId": "rg-acfmvoh45rhcfly",
      "arn": "acs:ecs:cn-heyuan:100931896542****:instance/i-f8z8psx67rksgpp3lb****",
      "relationship": "[{\"regionId\":\"cn-heyuan\",\"relationType\":\"IsAttachedTo\",\"resourceId\":\"d-f8zcofij6pjsju505sn5\",\"resourceType\":\"ACS::ECS::Disk\"}]",
      "configurationDiff": "",
      "resourceEventType": "RELATION_MODIFY",
      "resourceCreateTime": "1748923080000",
      "dataType": "ConfigurationItemChangeNotification",
      "resourceName": "launch-advisor-20250603",
      "version": "1748923229132000",
      "tags": {},
      "accountId": "100931896542****",
      "relationshipDiff": "{\"relationship_diff\":{\"relationship_add\":[{\"regionId\":\"cn-heyuan\",\"relationType\":\"IsAttachedTo\",\"resourceId\":\"d-f8zcofij6pjsju505sn5\",\"resourceType\":\"ACS::ECS::Disk\"}],\"relationship_delete\":[]}}",
      "resourceStatus": "Running",
      "regionId": "cn-heyuan",
      "resourceType": "ACS::ECS::Instance"
    }
  • 修改资源

    在单账号模式下,阿里云账号100931896542****在云服务器ECS的河源地域为云盘test_disk关联标签key1,在configurationDiff中显示云盘的标签变更前信息null和变更后信息key1,在relationshiprelationshipDiff中显示云盘删除相关资源rg-acfmvoh45r*****。

    {
      "resourceId": "d-f8zcofij6pjsju505sn****",
      "captureTime": "1748929932000",
      "configuration": "{\"DetachedTime\":\"\",\"Category\":\"cloud_essd\",\"KMSKeyId\":\"\",\"Description\":\"\",\"ResourceGroupId\":\"\",\"Size\":40,\"Encrypted\":false,\"DeleteAutoSnapshot\":false,\"DiskChargeType\":\"PostPaid\",\"Throughput\":110,\"IOPS\":2280,\"Attachments\":{\"Attachment\":[{\"AttachedTime\":\"2025-06-03T03:58:52Z\",\"InstanceId\":\"i-f8z8psx67rksgpp3lb****\",\"Device\":\"/dev/xvda\"}]},\"MultiAttach\":\"Disabled\",\"Placement\":{},\"ExpiredTime\":\"2999-09-08T16:00Z\",\"ImageId\":\"aliyun_3_x64_20G_alibase_20250117.vhd\",\"StorageSetId\":\"\",\"Tags\":{\"Tag\":[{\"TagKey\":\"key1\",\"TagValue\":\"\"}]},\"Status\":\"In_use\",\"AttachedTime\":\"2025-06-03T03:58:52Z\",\"StorageClusterId\":\"\",\"ZoneId\":\"cn-heyuan-a\",\"InstanceId\":\"i-f8z8psx67rksgpp3lb****\",\"ProductCode\":\"\",\"SourceSnapshotId\":\"\",\"Device\":\"/dev/xvda\",\"PerformanceLevel\":\"PL0\",\"DeleteWithInstance\":true,\"EnableAutomatedSnapshotPolicy\":false,\"EnableAutoSnapshot\":true,\"AutoSnapshotPolicyId\":\"\",\"DiskName\":\"\",\"BdfId\":\"\",\"OperationLocks\":{\"OperationLock\":[]},\"Portable\":true,\"Type\":\"system\",\"SerialNumber\":\"f8zcofij6pjsju505sn****\",\"CreationTime\":\"2025-06-03T03:58:50Z\",\"RegionId\":\"cn-heyuan\",\"DiskId\":\"d-f8zcofij6pjsju505sn****\"",
      "availabilityZone": "cn-heyuan-a",
      "requestId": "b7cdbb24-3ad0-470a-bf89-af8a8fa20****",
      "resourceGroupId": "rg-acfmvoh45rhcfly",
      "arn": "acs:ecs:cn-heyuan:100931896542****:disk/d-f8zcofij6pjsju505sn****",
      "relationship": "[{\"regionId\":\"cn-heyuan\",\"relationType\":\"IsAttachedTo\",\"resourceId\":\"i-f8z8psx67rksgpp3lb****\",\"resourceType\":\"ACS::ECS::Instance\"}]",
      "configurationDiff": "{\"Tags\":[{\"Tag\":[]},{\"Tag\":[{\"TagKey\":\"key1\",\"TagValue\":\"\"}]}]}",
      "resourceEventType": "MODIFY",
      "resourceCreateTime": "1748923130000",
      "dataType": "ConfigurationItemChangeNotification",
      "resourceName": "",
      "version": "1748929931726000",
      "tags": "{\"key1\":[\"\"]}",
      "accountId": "100931896542****",
      "relationshipDiff": "{\"relationship_diff\":{\"relationship_add\":[],\"relationship_delete\":[]}}",
      "resourceStatus": "In_use",
      "regionId": "cn-heyuan",
      "resourceType": "ACS::ECS::Disk"
    }
  • 删除资源

    在单账号模式下,阿里云账号100931896542****在云服务器ECS的河源地域删除云盘,在configurationDiff中显示云盘变更前信息和变更后信息null,在relationshiprelationshipDiff中显示云盘无相关资源。

    {
      "resourceId": "d-f8zcofij6pjsju505sn****",
      "captureTime": "1748931168000",
      "configuration": "{\"DetachedTime\":\"2025-06-03T06:09:30Z\",\"Category\":\"cloud_essd\",\"KMSKeyId\":\"\",\"Description\":\"\",\"ResourceGroupId\":\"\",\"Size\":40,\"Encrypted\":false,\"DeleteAutoSnapshot\":false,\"DiskChargeType\":\"PostPaid\",\"Throughput\":110,\"IOPS\":2280,\"Attachments\":{\"Attachment\":[{\"AttachedTime\":\"2025-06-03T06:10:11Z\",\"InstanceId\":\"i-f8z8psx67rksgpp3lb****\",\"Device\":\"/dev/xvda\"}]},\"MultiAttach\":\"Disabled\",\"Placement\":{},\"ExpiredTime\":\"2999-09-08T16:00Z\",\"ImageId\":\"aliyun_3_x64_20G_alibase_20250117.vhd\",\"StorageSetId\":\"\",\"Tags\":{\"Tag\":[{\"TagKey\":\"key1\",\"TagValue\":\"\"}]},\"Status\":\"In_use\",\"AttachedTime\":\"2025-06-03T06:10:11Z\",\"StorageClusterId\":\"\",\"ZoneId\":\"cn-heyuan-a\",\"InstanceId\":\"i-f8z8psx67rksgpp3lb****\",\"ProductCode\":\"\",\"SourceSnapshotId\":\"\",\"Device\":\"/dev/xvda\",\"PerformanceLevel\":\"PL0\",\"DeleteWithInstance\":true,\"EnableAutomatedSnapshotPolicy\":false,\"EnableAutoSnapshot\":true,\"AutoSnapshotPolicyId\":\"\",\"DiskName\":\"\",\"BdfId\":\"\",\"OperationLocks\":{\"OperationLock\":[]},\"Portable\":true,\"Type\":\"system\",\"SerialNumber\":\"f8zcofij6pjsju505sn****\",\"CreationTime\":\"2025-06-03T03:58:50Z\",\"RegionId\":\"cn-heyuan\",\"DiskId\":\"d-f8zcofij6pjsju505sn****\"",
      "availabilityZone": "cn-heyuan-a",
      "requestId": "1795c5e2-ce69-4a41-816d-c6c94f311a****",
      "resourceGroupId": "rg-acfmvoh45rhcfly",
      "arn": "acs:ecs:cn-heyuan:100931896542****:disk/d-f8zcofij6pjsju505sn****",
      "relationship": "",
      "configurationDiff": "{\"DetachedTime\":[\"2025-06-03T06:09:30Z\",null],\"Category\":[\"cloud_essd\",null],\"Description\":[\"\",\"\"],\"KMSKeyId\":[\"\",\"\"],\"ResourceGroupId\":[\"\",\"\"],\"Encrypted\":[false,null],\"Size\":[40,null],\"DeleteAutoSnapshot\":[false,null],\"DiskChargeType\":[\"PostPaid\",null],\"Throughput\":[110,null],\"IOPS\":[2280,null],\"Attachments\":[{\"Attachment\":[{\"AttachedTime\":\"2025-06-03T06:10:11Z\",\"InstanceId\":\"i-f8z8psx67rksgpp3lb****\",\"Device\":\"/dev/xvda\"}]},null],\"MultiAttach\":[\"Disabled\",null],\"Placement\":[{},null],\"ExpiredTime\":[\"2999-09-08T16:00Z\",null],\"ImageId\":[\"aliyun_3_x64_20G_alibase_20250117.vhd\",null],\"StorageSetId\":[\"\",\"\"],\"Tags\":[{\"Tag\":[{\"TagKey\":\"key1\",\"TagValue\":\"\"}]},null],\"Status\":[\"In_use\",null],\"AttachedTime\":[\"2025-06-03T06:10:11Z\",null],\"StorageClusterId\":[\"\",\"\"],\"ZoneId\":[\"cn-heyuan-a\",null],\"ProductCode\":[\"\",\"\"],\"InstanceId\":[\"i-f8z8psx67rksgpp3lb****\",null],\"SourceSnapshotId\":[\"\",\"\"],\"Device\":[\"/dev/xvda\",null],\"PerformanceLevel\":[\"PL0\",null],\"DeleteWithInstance\":[true,null],\"EnableAutomatedSnapshotPolicy\":[false,null],\"EnableAutoSnapshot\":[true,null],\"AutoSnapshotPolicyId\":[\"\",\"\"],\"DiskName\":[\"\",\"\"],\"BdfId\":[\"\",\"\"],\"OperationLocks\":[{\"OperationLock\":[]},null],\"Portable\":[true,null],\"Type\":[\"system\",null],\"SerialNumber\":[\"f8zcofij6pjsju505sn****\",null],\"CreationTime\":[\"2025-06-03T03:58:50Z\",null],\"RegionId\":[\"cn-heyuan\",null],\"DiskId\":[\"d-f8zcofij6pjsju505sn****\",null]}",
      "resourceEventType": "REMOVE",
      "resourceCreateTime": "1748923130000",
      "dataType": "ConfigurationItemChangeNotification",
      "resourceName": "",
      "version": "1748931699081000",
      "tags": "{\"key1\":[\"\"]}",
      "accountId": "100931896542****",
      "relationshipDiff": "{\"relationship_diff\":{\"relationship_add\":[],\"relationship_delete\":[{\"regionId\":\"cn-heyuan\",\"relationType\":\"IsAttachedTo\",\"resourceId\":\"i-f8z8psx67rksgpp3lb****\",\"resourceType\":\"ACS::ECS::Instance\"}]}}",
      "resourceStatus": "In_use",
      "regionId": "cn-heyuan",
      "resourceType": "ACS::ECS::Disk"
    }

参数说明

资源配置变更历史投递到日志服务SLS的主要参数说明如下表所示。

参数

说明

accountId

资源归属的账号ID。配置审计支持如下账号类型:

  • 单账号:未被管理账号加入资源目录的独立的阿里云账号ID。

  • 多账号:管理账号ID或成员ID。

availabilityZone

资源可用区。

captureTime

配置审计发现资源配置变更并生成日志的时间戳。

configuration

资源的详细配置。

configurationDiff

资源配置变更的具体变更项及变更前后信息。

dataType

日志服务SLS的接收内容。取值:

  • ConfigurationItemChangeNotification:资源配置变更历史。

  • NonCompliantNotification:资源不合规事件。

regionId

资源所在地域ID。

relationship

相关资源的详细信息,包括相关资源所在地域ID、资源关系、资源ID和资源类型。根据资源是否有相关资源,该参数显示如下:

relationshipDiff

相关资源的变更项。

resourceCreateTime

创建资源的时间戳。

resourceEventType

资源变更事件的类型。取值:

  • DISCOVERED:配置审计新发现的资源事件。

  • MODIFY:修改资源事件。

  • REMOVE:删除资源事件。

  • DISCOVERED_REVISED:配置审计新发现的通过周期修正任务产生的资源事件。

  • MODIFY_REVISED:通过周期修正任务产生的修改资源事件。

resourceGroupId

资源归属的资源组ID。根据资源类型是否支持资源组,该参数显示如下:

  • 当资源类型支持资源组时,该参数为资源组ID。

    关于支持资源组的云服务,请参见支持资源组的云服务

  • 当资源类型不支持资源组时,该参数为空。

resourceId

资源ID。

resourceName

资源名称。

resourceStatus

资源状态。资源的状态取决于各云服务对资源的定义,该参数可能为空。例如:

  • 当资源类型为ACS::ECS::Instance时,由于ECS实例有状态,因此该参数为RunningStopped

  • 当资源类型为ACS::OSS::Bucket时,由于OSS Bucket无状态,因此该参数为空。

resourceType

资源类型。关于支持配置审计的资源类型,请参见配置审计支持的资源类型和资源关系

tags

资源标签。