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

PropertyTypeRequiredEditableDescriptionConstraint
StatusStringNoYesThe 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 (,).
ImageOwnerAliasStringNoYesThe 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.
UsageStringNoYesSpecifies 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.
ActionTypeStringNoYesThe 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.
ResourceGroupIdStringNoYesThe 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.
ArchitectureStringNoYesThe architecture of the image. Valid values:
  • i386
  • x86_64
  • arm64
ImageFamilyStringNoYesThe name of the image family. You can use this property to query images that belong to the specified image family. None.
IsSupportIoOptimizedBooleanNoYesSpecifies whether the image can be used by an I/O optimized instance. Valid values:
  • true
  • false
IsSupportCloudinitBooleanNoYesSpecifies whether the image supports cloud-init. Valid values:
  • true
  • false
ImageNameStringNoYesThe name of the image. You can use the wild character () to query image names. Example: centos_8_5*.
SnapshotIdStringNoYesThe ID of the snapshot that is used by the custom image. None.
IsPublicBooleanNoYesSpecifies 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.
OSTypeStringNoYesThe OS type of the image. Valid values:
  • windows
  • linux
ImageIdStringNoYesThe ID of an image. None.
InstanceTypeStringNoYesThe type of the instance for which the image is used. None.
TagsListNoYesThe 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

PropertyTypeRequiredEditableDescriptionConstraint
ValueStringNoNoThe 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:.
KeyStringYesNoThe 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.
PropertyTypeDescriptionConstraint
ImageIdsListThe IDs of the images. Example: ['centos_8_5_x64_20G_alibase_20211228.vhd'].
ImagesListDetails of the images. None.
StatusStringThe 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.
ImageFamilyStringThe name of the image family. None.
ProgressStringThe progress of the operation that is performed on the image. Unit: %.
IsCopiedBooleanIndicates whether the image is a copy of another image. Valid values:
  • true
  • false
IsSupportIoOptimizedBooleanIndicates whether the image can be used by an I/O optimized instance. Valid values:
  • true
  • false
ImageOwnerAliasStringThe 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.
IsSupportCloudinitBooleanIndicates whether cloud-init is supported by the image. Valid values:
  • true
  • false
ImageVersionStringThe version of the image. None.
UsageStringIndicates 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.
IsSelfSharedStringIndicates whether the custom image is shared with other Alibaba Cloud accounts. Valid values:
  • true
  • false
DescriptionStringThe description of the image. None.
SizeIntegerThe size of the image. Unit: GiB.
ResourceGroupIdStringThe ID of the resource group to which the image belongs. Example: rg-bp67acfmxazb4p****.
PlatformStringThe OS. Example: Windows Server 2016.
OSNameEnStringThe display name of the OS. Example: Windows Server 2016 Data Center Edition 64bit Chinese Edition.
ImageNameStringThe name of the image. None.
OSNameStringNone.None.
ImageIdStringThe ID of an image. Example: m-bp1g7004ksh0oeuc****.
OSTypeStringThe OS type of the image. Valid values:
  • windows
  • linux
IsSubscribedBooleanIndicates whether the terms of the image service that corresponds to the product code are accepted. Valid values:
  • true
  • false
ProductCodeStringThe product code of the Alibaba Cloud Marketplace image. None.
ArchitectureStringThe architecture of the image. Valid values:
  • i386
  • x86_64
  • arm64
DiskDeviceMappingsListThe mappings between disks and snapshots in the image. None.
TagsListThe tags of the image. None.
IsPublicBooleanIndicates whether the images that are queried are published community images. Valid values:
  • true
  • false
ImageOwnerIdStringThe ID of the Alibaba Cloud account to which the image belongs. This property is returned only when shared images are queried.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      Images:
        Type: DATASOURCE::ECS::Images
        Properties:
          ImageName: centos_8_5*
    Outputs:
      ImageIds:
        Value:
          Ref: Images                    
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "Images": {
          "Type": "DATASOURCE::ECS::Images",
          "Properties": {
            "ImageName": "centos_8_5*"
          }
        }
      },
      "Outputs": {
        "ImageIds": {
          "Value": {
            "Ref": "Images"
          }
        }
      }
    }