All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::Images

最終更新日:Nov 01, 2024

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,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Status

String

No

Yes

The status of the image.

Valid values:

  • Available (default): 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 the need to subscribe to it. You must take note of the billing details of Alibaba Cloud Marketplace images.

Note

If you leave this property empty, the results that match the system, self, and others values are returned by default.

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.

Valid values:

  • CreateEcs (default): 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.

If you use this property to query resources, up to 1,000 resources that belong to the specified resource group are returned.

Note

This property takes effect when ImageOwnerAlias is set 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 image name.

The wildcard character (*) is supported. 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.

Valid values:

  • true: queries published community images. If you set this property to true, you must set ImageOwnerAlias to others.

  • false (default): queries images other than published community images. The type of the images that you can query varies based on the value of ImageOwnerAlias.

OSType

String

No

Yes

The OS type of the image.

Valid values:

  • windows

  • linux

ImageId

String

No

Yes

The image ID.

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 add up to 20 tags.

For more information, see Tags properties.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

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 tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Key

String

Yes

No

The tag key of the image.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. It 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 status 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 failed 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: percentage.

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 the need to subscribe to it. You must take note of the billing details of Alibaba Cloud Marketplace images.

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.

None.

Size

Integer

The image size.

Unit: GiB.

ResourceGroupId

String

The ID of the resource group to which the image belongs.

Example: rg-bp67acfmxazb4p****.

Platform

String

The OS platform.

Example: Windows Server 2016.

OSNameEn

String

The display name of the OS in English.

Example: Windows Server 2016 Data Center Edition 64bit Chinese Edition.

ImageName

String

The image name.

None.

OSName

String

The display name of the OS in Chinese.

None.

ImageId

String

The image ID.

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 OS 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 image that is queried is a published community image.

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

YAML format

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

JSON format

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