DATASOURCE::ECS::Images is used to query available images.

Syntax

{
  "Type": "DATASOURCE::ECS::Images",
  "Properties": {
    "Status": String,
    "ImageOwnerAlias": String,
    "Usage": String,
    "ActionType": String,
    "ResourceGroupId": String,
    "Architecture": String,
    "ImageFamily": String,
    "IsSupportIoOptimized": Boolean,
    "IsSupportCloudinit": Boolean,
    "ImageName": String,
    "SnapshotId": String,
    "IsPublic": Boolean,
    "OSType": String,
    "ImageId": String,
    "InstanceType": String,
    "Tags": List
  }
}

Properties

Property Type Required Editable Description Constraint
Status String No Yes The state of the image. Default value: Available. Valid values:
  • Available: The image is available.
  • Creating: The image is being created.
  • Waiting: The image is waiting to be processed.
  • UnAvailable: The image is unavailable.
  • CreateFailed: The image fails to be created.
  • Deprecated: The image is deprecated.
Note You can specify multiple values for this property. Separate multiple values with commas (,).
ImageOwnerAlias String No Yes The source of the image. Valid values:
  • system: a public image provided by Alibaba Cloud.
  • self: a custom image that you create.
  • others: a shared image from another Alibaba Cloud account.
  • marketplace: an image in Alibaba Cloud Marketplace. If an Alibaba Cloud Marketplace image is returned, you can use the image without subscription. You must take note of the billing details of the image.
Note If you do not specify this property, the results that match system, self, and others are returned.
Usage String No Yes Specifies whether the image is used by an Elastic Compute Service (ECS) instance. Valid values:
  • instance: The image is used by an ECS instance.
  • none: The image is not used by an ECS instance.
ActionType String No Yes The scenario in which you want to use the image. Default value: CreateEcs. Valid values:
  • CreateEcs: You want to use the image to create an instance.
  • ChangeOS: You want to use the image to change the system disk or the OS.
ResourceGroupId String No Yes The ID of the resource group to which the custom image belongs. When you use this property to query resources, the number of resources that are contained in the specified resource group cannot exceed 1,000.
Note This property takes effect when you set the ImageOwnerAlias property to self.
Architecture String No Yes The architecture of the image. Valid values:
  • i386
  • x86_64
  • arm64
ImageFamily String No Yes The name of the image family. You can use this property to query images that belong to the specified image family. None.
IsSupportIoOptimized Boolean No Yes Specifies whether the image can be used by an I/O optimized instance. Valid values:
  • true
  • false
IsSupportCloudinit Boolean No Yes Specifies whether the image supports cloud-init. Valid values:
  • true
  • false
ImageName String No Yes The name of the image. You can use the wild character () to query image names. Example: centos_8_5*.
SnapshotId String No Yes The ID of the snapshot that is used by the custom image. None.
IsPublic Boolean No Yes Specifies whether to query published community images. Default value: false. Valid values:
  • true: queries published community images. If you set this property to true, you must set the ImageOwnerAlias property to others.
  • false: queries other types of images than published community images. The image types that you can query vary based on the value of the ImageOwnerAlias property.
OSType String No Yes The OS type of the image. Valid values:
  • windows
  • linux
ImageId String No Yes The ID of an image. None.
InstanceType String No Yes The type of the instance for which the image is used. None.
Tags List No Yes The tags of the image. You can specify up to 20 tags.

For more information, see Tags properties.

Tags syntax

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

Tags properties

Property Type Required Editable Description Constraint
Value String No No The tag value of the image. The value can be up to 128 characters in length, and cannot contain http:// or https://. The value cannot start with aliyun or acs:.
Key String Yes No The tag key of the image. The key must be 1 to 128 characters in length, and cannot contain http:// or https://. The key cannot start with aliyun or acs:.

Return values (Fn::GetAtt)

  • ImageIds: the IDs of the images.
  • Images: details of the images.
Property Type Description Constraint
ImageIds List The IDs of the images. Example: ['centos_8_5_x64_20G_alibase_20211228.vhd'].
Images List Details of the images. None.
Status String The state of the image. Valid values:
  • Available: The image is available.
  • Creating: The image is being created.
  • Waiting: The image is waiting to be processed.
  • UnAvailable: The image is unavailable.
  • CreateFailed: The image fails to be created.
  • Deprecated: The image is deprecated.
ImageFamily String The name of the image family. None.
Progress String The progress of the operation that is performed on the image. Unit: %.
IsCopied Boolean Indicates whether the image is a copy of another image. Valid values:
  • true
  • false
IsSupportIoOptimized Boolean Indicates whether the image can be used by an I/O optimized instance. Valid values:
  • true
  • false
ImageOwnerAlias String The source of the image. Valid values:
  • system: a public image provided by Alibaba Cloud.
  • self: a custom image that you create.
  • others: a shared image from another Alibaba Cloud account.
  • marketplace: an image in Alibaba Cloud Marketplace. If an Alibaba Cloud Marketplace image is returned, you can use the image without subscription. You must take note of the billing details of the image.
IsSupportCloudinit Boolean Indicates whether cloud-init is supported by the image. Valid values:
  • true
  • false
ImageVersion String The version of the image. None.
Usage String Indicates whether the image is used by an ECS instance. Valid values:
  • instance: The image is used by an ECS instance.
  • none: The image is not used by an ECS instance.
IsSelfShared String Indicates whether the custom image is shared with other Alibaba Cloud accounts. Valid values:
  • true
  • false
Description String The description of the image. None.
Size Integer The size of the image. Unit: GiB.
ResourceGroupId String The ID of the resource group to which the image belongs. Example: rg-bp67acfmxazb4p****.
Platform String The OS. Example: Windows Server 2016.
OSNameEn String The display name of the OS. Example: Windows Server 2016 Data Center Edition 64bit Chinese Edition.
ImageName String The name of the image. None.
OSName String None. None.
ImageId String The ID of an image. Example: m-bp1g7004ksh0oeuc****.
OSType String The OS type of the image. Valid values:
  • windows
  • linux
IsSubscribed Boolean Indicates whether the terms of the image service that corresponds to the product code are accepted. Valid values:
  • true
  • false
ProductCode String The product code of the Alibaba Cloud Marketplace image. None.
Architecture String The architecture of the image. Valid values:
  • i386
  • x86_64
  • arm64
DiskDeviceMappings List The mappings between disks and snapshots in the image. None.
Tags List The tags of the image. None.
IsPublic Boolean Indicates whether the images that are queried are published community images. Valid values:
  • true
  • false
ImageOwnerId String The ID of the Alibaba Cloud account to which the image belongs. This property is returned only when shared images are queried.

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ImageName": {
          "Type": "String",
          "Default": "CentOS*"
        }
      },
      "Resources": {
        "Images": {
          "Type": "DATASOURCE::ECS::Images",
          "Properties": {
            "ImageName": {
              "Ref": "ImageName"
            }
          }
        }
      },
      "Outputs": {
        "ImageIds": {
          "Value": {
            "Ref": "Images"
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ImageName:
        Type: String
        Default: CentOS*
    Resources:
      Images:
        Type: DATASOURCE::ECS::Images
        Properties:
          ImageName:
            Ref: ImageName
    Outputs:
      ImageIds:
        Value:
          Ref: Images