ALIYUN::ECS::CustomImage is used to create a custom image.
Syntax
{
"Type": "ALIYUN::ECS::CustomImage",
"Properties": {
"Description": String,
"InstanceId": String,
"ImageName": String,
"SnapshotId": String,
"Tag": List,
"ResourceGroupId": String,
"Platform": String,
"DiskDeviceMapping": List,
"Architecture": String,
"ImageFamily": String,
"SourceRegionId": String,
"DetectionStrategy": String,
"ImageVersion": String,
"BootMode": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
Description | String | No | No | The description of the custom image. | The description must be 2 to 256 characters in length. It cannot start with |
InstanceId | String | No | No | The instance ID. | If you specify this property, an Elastic Compute Service (ECS) instance is used to create the custom image. For more information, see Create a custom image from an instance. |
ImageName | String | No | No | The name of the custom image. | The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter and cannot start with |
SnapshotId | String | No | No | The snapshot ID. | If you specify this property, a snapshot is used to create the custom image. For more information, see Create a custom image from a snapshot. |
Tag | List | No | No | The tags. | For more information, see Tag properties. |
ResourceGroupId | String | No | Yes | The ID of the resource group to which the custom image belongs. | None. |
Platform | String | No | No | The distribution of the OS for the system disk. If you specify a data disk snapshot to create the system disk of the custom image, you must use the Platform property to specify the distribution of the OS for the system disk. | Valid values:
|
DiskDeviceMapping | List | No | No | The mappings between the custom image and the snapshot. | For more information, see DiskDeviceMapping properties. |
Architecture | String | No | No | The system architecture of the system disk. If you specify a data disk snapshot to create the system disk of the custom image, you must use the Architecture property to specify the system architecture of the system disk. | Valid values:
|
ImageFamily | String | No | No | The name of the image family. | The name must be 2 to 128 characters in length, and can contain letters, digits, colons(:), underscores (_), and hyphens (-). It must start with a letter and cannot start with |
SourceRegionId | String | No | No | The ID of the region to which the instance or snapshot belongs. | By default, the ID of the current region is used. |
DetectionStrategy | String | No | No | The mode that you want to use to check the custom image. | If you do not specify this property, the custom image is not checked. Only the standard check mode is supported. Note Most Linux and Windows distributions are supported. For more information about the check items and the OS limits for image checks, see Overview and Operating system limits for image check. |
ImageVersion | String | No | No | The version of the custom image. | If you specify InstanceId and the image of the instance is an Alibaba Cloud Marketplace image or a custom image created from an Alibaba Cloud Marketplace image, you must leave ImageVersion empty or set ImageVersion to the image version of the instance. |
BootMode | String | No | No | The boot mode of the custom image. | Valid values:
Note You must familiarize yourself with the boot modes that are supported by the specified image. When you use this property to change the boot mode of the image, you must specify a supported boot mode for the image. This way, instances that use the image can be started as expected. |
Tag syntax
"Tag": [
{
"Key": String,
"Value": String
}
]
Tag properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | No | No | The tag key. | The tag key must be 1 to 128 characters in length, and cannot contain |
Value | String | No | No | The tag value. | The tag value can be up to 128 characters in length, and cannot contain |
DiskDeviceMapping syntax
"DiskDeviceMapping": [
{
"Device": String,
"SnapshotId": String,
"Size": Integer,
"DiskType": String
}
]
DiskDeviceMapping properties
Property | Type | Required | Editable | Description | Constraint |
Device | String | No | No | The device name of the disk in the custom image. | Valid values:
|
SnapshotId | String | No | No | The snapshot ID. | None. |
Size | Integer | No | No | The disk size. |
Unit: GiB. |
DiskType | String | No | No | The type of the disk in the custom image. | You can use this property to create the system disk of the custom image from a data disk snapshot. If you leave this property empty, the disk type of the snapshot is used. Valid values:
|
Return values
Fn::GetAtt
ImageId: the ID of the custom image.
SourceRegionId: the ID of the region to which the instance or snapshot belongs.
Examples
For more examples, visit CustomImage.json and CustomImage.yml. In the examples, the ALIYUN::ECS::CustomImage and ALIYUN::ECS::CopyImage resource types are used.