ALIYUN::ECS::CopyImage is used to copy a custom image from one region to another region.
Syntax
{
"Type": "ALIYUN::ECS::CopyImage",
"Properties": {
"Encrypted": Boolean,
"DestinationImageName": String,
"ImageId": String,
"DestinationRegionId": String,
"SourceRegionId": String,
"Tag": List,
"DestinationDescription": String,
"KMSKeyId": String,
"ResourceGroupId": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Encrypted | Boolean | No | No | Specifies whether to encrypt the image copy. | Default value: false. Valid values:
|
DestinationImageName | String | No | No | The name of the image copy. | The name must be 2 to 128 characters in length. The name must start with a letter but cannot start with http:// or https:// . The name can contain letters, digits, colons(:), underscores (_), and hyphens (-). |
ImageId | String | Yes | No | The ID of the source custom image. | None. |
DestinationRegionId | String | Yes | No | The ID of the region in which the image copy is deployed. | None. |
SourceRegionId | String | No | No | The ID of the region in which the source custom image is deployed. | By default, the ID of the current region is used. |
Tag | List | No | No | The tags of the image copy. | For more information, see Tag properties. |
DestinationDescription | String | No | No | The description of the image copy. | The description must be 2 to 256 characters in length, and cannot start with http:// or https:// . |
KMSKeyId | String | No | No | The ID of the key that you want to use to encrypt the image copy. | None. |
ResourceGroupId | String | No | Yes | The ID of the resource group to which the image copy belongs. | None. |
Tag syntax
"Tag": [
{
"Key": String,
"Value": String
}
]
Tag properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key | String | No | No | The key of the tag. | The tag key must be 1 to 128 characters in length, and cannot contain http:// or https:// . The tag key cannot start with aliyun or acs: . |
Value | String | No | No | The value of the tag. | The tag value can be up to 128 characters in length, and cannot contain http:// or https:// . The tag value cannot start with aliyun or acs: . |
Return values
Fn::GetAtt
- ImageId: the ID of the image copy.
- DestinationRegionId: the ID of the region in which the image copy is deployed.
- SourceRegionId: the ID of the region in which the source custom image is deployed.
Examples
JSON
format{ "ROSTemplateFormatVersion": "2015-09-01", "Description": { "en": "Create ECS CopyImage" }, "Parameters": { "ImageId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::Image::ImageId", "AssociationPropertyMetadata": { "SupportedImageOwnerAlias": [ "self" ] } } }, "Resources": { "CopyImage": { "Type": "ALIYUN::ECS::CopyImage", "Properties": { "Encrypted": false, "ImageId": { "Ref": "ImageId" }, "DestinationRegionId": "cn-shanghai", "SourceRegionId": "cn-hangzhou", "DestinationDescription": "Test CopyImage" } } }, "Outputs": { "CopyImageId": { "Value": { "Fn::GetAtt": [ "CopyImage", "ImageId" ] } } } }
For more examples, visit CustomImage.json and CustomImage.yml. In the examples, the ALIYUN::ECS::CustomImage and ALIYUN::ECS::CopyImage resource types are used.