ALIYUN::ECS::InstanceClone is used to clone an Elastic Compute Service (ECS) instance.
Syntax
{
"Type": "ALIYUN::ECS::InstanceClone",
"Properties": {
"DeletionProtection": Boolean,
"DiskMappings": List,
"LoadBalancerIdToAttach": String,
"Description": String,
"BackendServerWeight": Integer,
"Tags": List,
"SecurityGroupId": String,
"RamRoleName": String,
"ImageId": String,
"ResourceGroupId": String,
"SpotPriceLimit": String,
"InstanceChargeType": String,
"SourceInstanceId": String,
"Period": Number,
"SpotStrategy": String,
"Password": String,
"InstanceName": String,
"ZoneId": String,
"KeyPairName": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
ResourceGroupId | String | No | No | The ID of the resource group to which the new ECS instance belongs. | None. |
SourceInstanceId | String | Yes | No | The ID of the source ECS instance. | You can clone all data and settings of the source ECS instance, including the instance type, image, bandwidth metering method, bandwidth limit, and network type. If the source ECS instance belongs to multiple security groups, the new instance is added to the first security group. |
BackendServerWeight | Integer | No | No | The weight that is assigned to the new ECS instance in the Server Load Balancer (SLB) instance. | Valid values: 0 to 100. Default value: 100. |
LoadBalancerIdToAttach | String | No | No | The ID of the SLB instance to which you want to add the new ECS instance. | None. |
Description | String | No | No | The description of the new ECS instance. | The description can be up to 256 characters in length. |
ImageId | String | No | Yes | The ID of the image that is used to start the new ECS instance. You can use a public image, a custom image, or an Alibaba Cloud Marketplace image. | When you specify a public image ID, you can enter a partial image ID instead of the complete image ID. Examples:
|
SecurityGroupId | String | No | No | The ID of the security group to which the new ECS instance belongs. | None. |
InstanceName | String | No | No | The name of the new ECS instance. | The name must be 2 to 128 characters in length, and can contain letters, digits, colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with |
Password | String | No | No | The password that is used to log on to the new ECS instance. | The password must be 8 to 30 characters in length. The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include If you specify this property, you must call specific Resource Orchestration Service (ROS) API operations by using HTTPS to prevent the exposure of your password. |
DiskMappings | List | No | No | The disks that you want to attach to the new ECS instance. | You can attach up to 16 disks. For more information, see DiskMappings properties. |
Tags | List | No | Yes | The tags that you want to add to the new ECS instance. | You can add up to 20 tags in the following format: For more information, see Tags properties. |
ZoneId | String | No | No | The ID of the zone. | None. |
InstanceChargeType | String | No | No | The billing method of the new ECS instance. | Default value: PostPaid. Valid values:
|
Period | Number | No | No | The billing cycle of the new ECS instance. | Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Unit: months. This property is required if you set the InstanceChargeType property to PrePaid. This property is optional if you set the InstanceChargeType property to PostPaid. |
KeyPairName | String | No | Yes | The name of the key pair that is used to connect to the new ECS instance. | Windows instances: By default, this property is empty. Linux instances: The Password property takes effect even if you specify the KeyPairName property. However, logon by password is disabled, and the value of the KeyPairName property is used by default. |
RamRoleName | String | No | No | The RAM role name for the new ECS instance. | For more information, see CreateRole and ListRoles. |
SpotPriceLimit | String | No | No | The maximum hourly price that you specify for the new ECS instance. | The value of this property can contain up to three decimal places. This property takes effect when you set the SpotStrategy property to SpotWithPriceLimit. |
SpotStrategy | String | No | No | The bidding policy for the pay-as-you-go instance. | This property takes effect when you set the InstanceChargeType property to PostPaid. Default value: NoSpot. Valid values:
|
DeletionProtection | Boolean | No | No | Specifies whether to enable deletion protection to allow you to release the new ECS instance by using the ECS console or by calling the DeleteInstance operation. | Default value: false. Valid values:
|
DiskMappings syntax
"DiskMappings": [
{
"Category": String,
"DiskName": String,
"Description": String,
"Device": String,
"SnapshotId": String,
"PerformanceLevel": String,
"Size": String
}
]
DiskMappings properties
Property | Type | Required | Editable | Description | Constraint |
Size | String | Yes | No | The size of the data disk. | Valid values: 20 to 500. Unit: GB. |
Category | String | No | No | The category of the data disk. | Valid values:
For I/O optimized instances, the default value is cloud_efficiency. For non-I/O optimized instances, the default value is cloud. |
DiskName | String | No | No | The name of the data disk. | The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), colons (:), and hyphens (-). The name must start with a letter but cannot start with |
PerformanceLevel | String | No | No | The performance level (PL) of the ESSD that is used as the system disk. | Default value: PL1. Valid values:
For more information about how to select the PLs of ESSDs, see ESSDs. |
Description | String | No | No | The description of the disk. | The description must be 2 to 256 characters in length. By default, this property is empty. |
Device | String | No | No | The mount target of the disk. | This property will be removed in the future. We recommend that you use other properties to improve code compatibility. |
SnapshotId | String | No | No | The ID of the snapshot that you want to use to create the data disk. | None. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The key of the tag. | The key must be 1 to 128 characters in length, and cannot contain |
Value | String | No | No | The value of the tag. | The value can be up to 128 characters in length, and cannot contain |
Return values
Fn::GetAtt
InstanceId: the ID of the new ECS instance. The instance ID is a GUID that is generated by the system for an instance.
PrivateIp: the private IP address of the new ECS instance in a virtual private cloud (VPC). This property takes effect when the NetworkType property is set to
vpc
.InnerIp: the private IP address of the new ECS instance in the classic network. This property takes effect when the NetworkType property is set to
classic
.PublicIp: the public IP address of the new ECS instance in the classic network. This property takes effect when the NetworkType property is set to
classic
.ZoneId: the ID of the zone.
HostName: the hostname of the new ECS instance.
PrimaryNetworkInterfaceId: the ID of the primary elastic network interface (ENI).
SecurityGroupIds: the IDs of security groups to which the new ECS instance belongs.
Examples
For more examples, visit InstanceClone.json and InstanceClone.yml.