DATASOURCE::ECS::Disks is used to query the Elastic Block Storage (EBS) devices that you created. The following EBS devices are supported: cloud disks and local disks.

Syntax

{
  "Type": "DATASOURCE::ECS::Disks",
  "Properties": {
    "Status": String,
    "DiskIds": List,
    "EnableShared": String,
    "Category": String,
    "KMSKeyId": String,
    "ResourceGroupId": String,
    "ZoneId": String,
    "InstanceId": String,
    "Encrypted": Boolean,
    "DeleteWithInstance": Boolean,
    "DeleteAutoSnapshot": String,
    "EnableAutomatedSnapshotPolicy": Boolean,
    "DiskChargeType": String,
    "EnableAutoSnapshot": Boolean,
    "AutoSnapshotPolicyId": String,
    "DiskName": String,
    "MultiAttach": String,
    "DiskType": String,
    "SnapshotId": String,
    "Portable": String,
    "Filters": List,
    "AdditionalAttributes": List,
    "Tags": List
  }
}

Properties

Property Type Required Editable Description Constraint
Status String No Yes The status of the cloud disk. Default value: All. Valid values:
  • In_use: The cloud disk is being used.
  • Available: The cloud disk is available.
  • Attaching: The cloud disk is being attached.
  • Detaching: The cloud disk is being detached.
  • Creating: The cloud disk is being created.
  • ReIniting: The cloud disk is being initialized.
  • All: all status.
DiskIds List No Yes The IDs of the cloud disks or local disks. You can specify up to 100 IDs. Separate the IDs with commas (,).

Example: ["d-bp67acfmxazb4p****", "d-bp67acfmxazb4g****", … "d-bp67acfmxazb4d****"].

EnableShared String No Yes Specifies whether the disk is a Shared Block Storage device. Default value: false. Valid values:
  • true
  • false
Category String No Yes The category of the cloud disk or the local disk. Valid values:
  • all: all categories of cloud disks and local disks
  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: enhanced SSD (ESSD)
  • local_ssd_pro: I/O-bound local disk
  • local_hdd_pro: throughput-bound local disk
KMSKeyId String No Yes The ID of the Key Management Service (KMS) key that is used by the cloud disk. None.
ResourceGroupId String No Yes The ID of the resource group to which the cloud disk or the local disk belongs. None.
ZoneId String No Yes The ID of the zone. None.
InstanceId String No Yes The ID of the instance to which you attach the cloud disk or the local disk. None.
Encrypted Boolean No Yes Specifies whether the cloud disk is encrypted. Default value: false. Valid values:
  • true
  • false
DeleteWithInstance Boolean No Yes Specifies whether to release the cloud disk when you release the instance to which the disk is attached. Default value: false. Valid values:
  • true: releases the cloud disk when you release the instance.
  • false: retains and converts the cloud disk into a pay-as-you-go data disk when you release the instance.
DeleteAutoSnapshot String No Yes Specifies whether to delete the automatic snapshot of the cloud disk when you release the cloud disk. Default value: false. Valid values:
  • true
  • false
EnableAutomatedSnapshotPolicy Boolean No Yes Specifies whether an automatic snapshot policy is configured for the cloud disk. Default value: false. Valid values:
  • true
  • false
DiskChargeType String No Yes The billing method of the cloud disk or local disk. Valid values:
  • PrePaid: subscription
  • PostPaid: pay-as-you-go
EnableAutoSnapshot Boolean No Yes Specifies whether to enable the automatic snapshot policy for the cloud disk. Default value: false. Valid values:
  • true
  • false
AutoSnapshotPolicyId String No Yes The ID of the automatic snapshot policy that is applied to the cloud disk. None.
DiskName String No Yes The name of the cloud disk or local disk. None.
MultiAttach String No Yes Specifies whether to enable the multi-attach feature. Valid values:
  • Disabled: disables the multi-attach feature.
  • Enabled: enables the multi-attach feature.
  • LegacyShared: queries Shared Block Storage devices.
DiskType String No Yes The type of the cloud disk or local disk that you want to query. Default value: all. Valid values:
  • all: system disk and data disk
  • system: system disk
  • data: data disk
SnapshotId String No Yes The ID of the snapshot from which you create the cloud disk. None.
Portable String No Yes Specifies whether the cloud disk or the local disk is removable. Valid values:
  • true
  • false
Filters List No Yes The filters that are used to query resources. Valid values: 1 and 2.

For more information, see Filters properties.

AdditionalAttributes List No Yes The additional attributes of the disk. Set the value of this property to IOPS, which specifies the maximum IOPS of the disk that you want to query.
Tags List No Yes The tags of the cloud disk or local disk. For more information, see Tags properties.

Filters syntax

"Filters": [
  {
    "Value": String,
    "Key": String
  }
]

Filters properties

Property Type Required Editable Description Constraint
Value String No No The value of the filter. Example: 2021-12-12T12:12Z.
Key String Yes No The key of the filter. Example: CreationStartTime.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property Type Required Editable Description Constraint
Value String No No The value of the tag. None.
Key String Yes No The key of the tag. None.

Return values (Fn::GetAtt)

  • DiskIds: the IDs of cloud disks or local disks.
  • Disks: the details of the cloud disks or local disks.
Property Type Description Constraint
DiskIds List The IDs of cloud disks or local disks. Example: ['d-bp180bogui4ky7o4****','d-bp180bogui4ky7o4****'].
Disks List The details of the cloud disks or local disks. None.
Type String The type of the cloud disk or local disk. None.
Status String The status of the cloud disk. None.
SerialNumber String The serial number of the cloud disk or local disk. Example: bp18um4r4f2fve2****.
PerformanceLevel String The performance level (PL) of the ESSD. Valid values:
  • PL0: An ESSD delivers up to 10,000 random read/write IOPS.
  • PL1: An ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: An ESSD delivers up to 1,000, 000 random read/write IOPS.
EnableAutoSnapshot Boolean Indicates whether the automatic snapshot policy is enabled for the cloud disk. None.
StorageSetId String The ID of the storage set. Example: ss-i-bp1j4i2jdf3owlhe****.
DiskId String The ID of the cloud disk or local disk. Example: d-bp18um4r4f2fve24****.
StorageSetPartitionNumber Integer The maximum number of partitions in the storage set. None.
MultiAttach String Indicates whether the multi-attach feature is enabled. None.
DeleteAutoSnapshot Boolean Indicates whether the automatic snapshot of the cloud disk is deleted when you release the disk. None.
Encrypted Boolean Indicates whether the cloud disk is encrypted. None.
IOPSRead Integer The number of read operations per second.
MountInstanceNum Integer The number of instances to which the Shared Block Storage device is attached. None.
Description String The description of the cloud disk or local disk. None.
Device String The device name of the instance to which the cloud disk or local disk is attached. If you set the Status property to In_use, this property is returned. This property is empty for cloud disks for which the multi-attach feature is enabled.

Example: /dev/xvda.

DiskName String The name of the cloud disk or local disk. None.
Portable Boolean Indicates whether the cloud disk or local disk is removable. None.
StorageClusterId String The ID of the dedicated block storage cluster to which the cloud disk belongs. If your cloud disk belongs to a public block storage cluster, this property is empty.
ImageId String The ID of the image that is used to create the Elastic Compute Service (ECS) instance. This property is returned only if cloud disks are created from images. Otherwise, this property is empty.
DeleteWithInstance Boolean Indicates whether the cloud disk is released when you release the instance to which the disk is attached. None.
KMSKeyId String The ID of the KMS key that is used by the cloud disk. None.
DetachedTime String The time when the cloud disk was last detached. The time is displayed in UTC. Example: 2021-06-07T21:01:22Z.
SourceSnapshotId String The ID of the snapshot from which the cloud disk is created. If the cloud disk is not created from a snapshot, this property is empty.
AutoSnapshotPolicyId String The ID of the automatic snapshot policy that is applied to the cloud disk. None.
EnableAutomatedSnapshotPolicy Boolean Indicates whether an automatic snapshot policy is configured for the cloud disk. None.
IOPSWrite Integer The number of write operations per second.
InstanceId String The ID of the instance to which the cloud disk or local disk is attached. None.
IOPS Integer The number of I/O per second.
ExpiredTime String The time when the subscription cloud disk expired. The time is displayed in UTC. Example: 2021-07-07T16:00Z.
Size Integer The size of the cloud disk or local disk. Example: 60.
ResourceGroupId String The ID of the resource group to which the cloud disk or local disk belongs. None.
ZoneId String The ID of the zone to which the cloud disk or local disk belongs. None.
DiskChargeType String The billing method of the cloud disk or local disk. None.
Category String The category of the cloud disk or local disk. None.
AttachedTime String The time when the cloud disk was last attached. The time is displayed in UTC. Example: 2021-06-05T21:01:22Z.
ProductCode String The product code of the disk in Alibaba Cloud Marketplace. None.
OperationLocks List The reasons why the cloud disk or local disk is locked. None.
Tags List The tags of the cloud disk or local disk. Sample value:
[
      {
        "Value": "value_test",
        "Key": "key_test"
      },
      {
        "Value": "value_test2",
        "Key": "key_test2"
      }
    ]
Attachments List The attachment information about the cloud disk. The value is a list that consists of the values in Attachment. This value is not returned when you query Shared Block Storage devices.

Example:

 [
      {
        "AttachedTime": "2022-02-14T09:13:39Z",
        "InstanceId": "i-bp1evllqxw6b1srq****",
        "Device": "/dev/xvda"
      }
    ],

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Resources": {
        "Disks": {
          "Type": "DATASOURCE::ECS::Disks",
          "Properties": {
            "Filters": [
              {
                "Key": "CreationStartTime",
                "Value": "2021-12-12T12:12Z"
              }
            ]
          }
        }
      },
      "Outputs": {
        "Disks": {
          "Value": {
            "Fn::GetAtt": [
              "Disks",
              "Disks"
            ]
          }
        },
        "DisksIds": {
          "Value": {
            "Fn::GetAtt": [
              "Disks",
              "DiskIds"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Resources:
      Disks:
        Type: DATASOURCE::ECS::Disks
        Properties:
          Filters:
            - Key: CreationStartTime
              Value: 2021-12-12T12:12Z
    Outputs:
      Disks:
        Value:
          Fn::GetAtt:
            - Disks
            - Disks
      DisksIds:
        Value:
          Fn::GetAtt:
            - Disks
            - DiskIds