ALIYUN::ECS::InstanceGroupClone is used to clone an ECS instance group.

Syntax

{
  "Type": "ALIYUN::ECS::InstanceGroupClone",
  "Properties": {
    "BackendServerWeight": Integer,
    "DiskMappings": List,
    "LaunchTemplateName": String,
    "SpotPriceLimit": String,
    "ResourceGroupId": String,
    "KeyPairName": String,
    "SystemDiskDiskName": String,
    "PeriodUnit": String,
    "Description": String,
    "Tags": List,
    "AutoRenewPeriod": Number,
    "ImageId": String,
    "AutoRenew": String,
    "SpotStrategy": String,
    "SourceInstanceId": String,
    "EniMappings": List,
    "Password": String,
    "MaxAmount": Integer,
    "AutoReleaseTime": String,
    "SystemDiskCategory": String,
    "LoadBalancerIdToAttach": String,
    "LaunchTemplateId": String,
    "LaunchTemplateVersion": String,
    "ZoneId": String,
    "InternetMaxBandwidthOut": Integer,
    "InstanceName": String,
    "InternetMaxBandwidthIn": Integer,
    "DeletionProtection": Boolean,
    "DeploymentSetId": String,
    "SecurityGroupId": String,
    "RamRoleName": String,
    "HpcClusterId": String,
    "SystemDiskDescription": String,
    "Ipv6AddressCount": Integer,
    "Ipv6Addresses": List,
    "SystemDiskAutoSnapshotPolicyId": String
  }
}

Properties

Name Type Required Editable Description Validity
ResourceGroupId String No No The ID of the enterprise resource group to which created instances belong. None
HpcClusterId String No Yes The ID of the E-HPC cluster to which created instances belong. None
SourceInstanceId String Yes No The ID of the source ECS instance to be cloned. The clone operation clones the specified instance, including its instance type, image, billing method for network usage, bandwidth limit, and network type. If the source ECS instance belongs to multiple security groups, the cloned instance is added only to the first of these security groups.
MaxAmount Integer Yes Yes The maximum number of ECS instances that can be created at a time. Valid values: 1 to 100. The MaxAmount parameter must be set to a value greater than or equal to the value of the MinAmount parameter.
MinAmount String Yes Yes The minimum number of ECS instances that can be created at a time. Valid values: 1 to 100. The MinAmount parameter must be set to a value less than or equal to the value of the MaxAmount parameter.
BackendServerWeight Integer No No The weight assigned to created ECS instances in the 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 attach the created ECS instances. None
Description String No No The description of created instances. The description can be up to 256 characters in length.
ImageId String No Yes The ID of the image used to start created instances. You can use a public image, a custom image, or an Alibaba Cloud Marketplace image. You can specify a partial public image ID instead of providing the complete ID. For example, if you enter ubuntu, the system matches it with the following ID: ubuntu_16_0402_64_20G_alibase_20170818.vhd. If you enter ubuntu1432, the system matches it with the following ID: ubuntu_14_0405_32_40G_alibase_20170711.vhd. For more information, see Request parameters.
InternetMaxBandwidthOut Integer No No The maximum bandwidth of the outbound traffic to the Internet. Unit: Mbit/s. Valid values for the PayByBandwidth mode: 0 to 200. Valid values for the PayByTraffic mode: 1 to 200.
SecurityGroupId String No No The ID of the security group to which created instances belong. None
InstanceName String No No The names of created instances. The names can be up to 128 characters in length and can contain letters, digits, underscores (_), periods (.), and hyphens (-).
Password String No No The password used to log on to created ECS instances. The password must be 8 to 30 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include ( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' < > , . ? /

If you specify the Password parameter in the API request, use HTTPS to secure the API and protect your password.

DiskMappings List No No The disks to be attached to created instances. A maximum of 16 disks can be attached to each instance.
Tags List No No The custom tags of created instances. A maximum of 20 tags can be specified for each instance in the [{"Key":"tagKey","Value":"tagValue"},{"Key":"tagKey2","Value":"tagValue2"}] format.
ZoneId String No No The ID of the zone. None
KeyPairName String No No The name of the key pair that is used to connect to created ECS instances. For Windows-based ECS instances, this parameter is ignored. For Linux-based ECS instances, the Password parameter still takes effect if this parameter is specified. However, logon by password is disabled, and the KeyPairName value is used.
RamRoleName String No No The RAM role name of created ECS instances. You can call the ListRoles operation to query the role name. For more information, see CreateRole and ListRoles.
SpotPriceLimit String No No The maximum hourly price for created ECS instances. Three decimal places are allowed at most. This parameter takes effect only when the SpotStrategy parameter is set to SpotWithPriceLimit.
SpotStrategy String No No The bidding policy for pay-as-you-go instances. This parameter takes effect only when the InstanceChargeType parameter is set to PostPaid. Valid values: NoSpot, SpotWithPriceLimit, and SpotAsPriceGo. A value of NoSpot applies to regular pay-as-you-go instances. A value of SpotWithPriceLimit applies to pay-as-you-go instances with a maximum hourly price. A value of SpotAsPriceGo applies to pay-as-you-go instances priced at the market price at the time of purchase. Default value: NoSpot.
SystemDiskDiskName String No Yes The name of the system disk. 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 http:// or https://. This parameter is empty by default.
PeriodUnit String No Yes The unit of billing cycle for created instances. Valid values: Week and Month. Default value: Month. Valid values for the Period parameter when this parameter is set to Week: 1, 2, 3, and 4. Valid values for the AutoRenewPeriod parameter when this parameter is set to Week: 1, 2, and 3. Valid values for the Period parameter when this parameter is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60. Valid values for the AutoRenewPeriod parameter when this parameter is set to Month: 1, 2, 3, 6, and 12.
AutoRenewPeriod Number No Yes The automatic renewal period for created instances. This parameter is required when the AutoRenew parameter is set to true. Valid values: 1, 2, 3, 6, and 12. Default value: 1.
AutoRenew String No Yes Specifies whether to enable automatic renewal for created instances. This parameter takes effect only when the InstanceChargeType parameter is set to PrePaid. Valid values: true and false. A value of true specifies that automatic renewal is enabled for created instances. A value of false specifies that automatic renewal is disabled for created instances. Default value: false.
EniMappings List No Yes The elastic network interfaces (ENIs) to be attached to created instances. Only one ENI can be attached to each instance.
AutoReleaseTime String No No The time scheduled for created ECS instances to be automatically released. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The maximum release time must be within three years from the current time.
SystemDiskCategory String No Yes The type of the system disk. Valid values: cloud, cloud_efficiency, cloud_ssd, and cloud_essd.
LaunchTemplateName String No Yes The name of the launch template. None
LaunchTemplateVersion String No Yes The version of the launch template. If you do not specify this parameter, the default version is used.
InternetMaxBandwidthIn Integer No No The maximum bandwidth of the inbound traffic from the Internet. Unit: Mbit/s. Valid values: 1 to 100. Default value: 100.
LaunchTemplateId String No Yes The ID of the launch template. None
SystemDiskDescription String No Yes The description of the system disk. None
DeletionProtection Boolean No No The release protection property of created instances. It specifies whether the instances can be released from the ECS console or through the DeleteInstance operation. Valid values: true and false.
DeploymentSetId String No Yes The ID of the deployment set. None
Ipv6AddressCount Integer No Yes The number of randomly generated IPv6 addresses that are allocated to the ENI. You can specify either the Ipv6Addresses parameter or the Ipv6AddressCount parameter. But you cannot specify both of them.
Ipv6Addresses List No Yes The list of IPv6 addresses allocated to the ENI. The list can contain only one IPv6 address. Property modification does not affect existing instances. You can specify either the Ipv6Addresses parameter or the Ipv6AddressCount parameter. But you cannot specify both of them.
SystemDiskAutoSnapshotPolicyId String No Yes The ID of the automatic snapshot policy for the system disk. None

DiskMappings syntax

"DiskMappings": [
  {
    "Category": String,
    "DiskName": String,
    "Description": String,
    "Encrypted": String,
    "KMSKeyId": String,
    "Device": String,
    "SnapshotId": String,
    "Size": String,
    "AutoSnapshotPolicyId": String
  }
]

DiskMappings properties

Name Type Required Editable Description Validity
Size String Yes No The size of the data disk. Unit: GB.
Category String No No The type of the data disk. Valid values: cloud, cloud_efficiency, cloud_ssd, and cloud_essd. Default value: cloud.
DiskName String No No The name of the data disk. The name can be up to 128 characters in length and can contain letters, digits, underscores (_), periods (.), and hyphens (-).
Description String No No The description of the data disk. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
Device String No No The device name of the data disk. The system allocates a device name in alphabetical order from /dev/xvda to /dev/xvdz.
SnapshotId String No No The ID of the snapshot. None
Encrypted String No No Specifies whether to encrypt the data disk. Default value: false.
KMSKeyId String No No The ID of the KMS key corresponding to the data disk. None
AutoSnapshotPolicyId String No No The ID of the automatic snapshot policy. None

EniMappings syntax

"EniMappings": [
  {
    "SecurityGroupId": String,
    "VSwitchId": String,
    "Description": String,
    "NetworkInterfaceName": String,
    "PrimaryIpAddress": String
  }
]

EniMappings properties

Name Type Required Editable Description Validity
SecurityGroupId String Yes Yes The ID of the security group to which the ENI belongs. None
VSwitchId String Yes No The ID of the VSwitch to which the ENI belongs. None
Description String No Yes The description of the ENI. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
NetworkInterfaceName String No Yes The name of the ENI. None
PrimaryIpAddress String No No The primary IP address of the ENI. None

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Name Type Required Editable Description Validity
Key String Yes No None None
Value String No No None None

Response parameters

Fn::GetAtt

  • InstanceIds: the IDs of instances in the ECS instance group. An ID is a system-generated globally unique identifier (GUID) for an instance.
  • PrivateIps: the list of private IP addresses of instances in a VPC. This parameter takes effect only when the NetworkType parameter is set to VPC. The list is a JSON array, containing up to 100 IP addresses separated with commas (,). Example: ["172.16.XX.XX", "172.16. XX.XX", ... "172.16. XX.XX"].
  • InnerIps: the list of private IP addresses of instances in a classic network. This parameter takes effect only when the NetworkType parameter is set to Classic. The list is a JSON array, containing up to 100 IP addresses separated with commas (,). Example: ["10.1.XX.XX", "10.1. XX.XX", ... "10.1. XX.XX"].
  • PublicIps: the list of public IP addresses of instances in a classic network. This parameter takes effect only when the NetworkType parameter is set to Classic. The list is a JSON array, containing up to 100 IP addresses separated with commas (,). Example: ["42.1.XX.XX", "42.1. XX.XX", ... "42.1. XX.XX"].
  • HostNames: the list of hostnames of all instances.
  • ZoneIds: the IDs of zones where created instances reside.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "WebServer": {
      "Type": "ALIYUN::ECS::InstanceGroupClone",
      "Properties": {
        "SourceInstanceId": "i-25zsk****",
        "ImageId": "m-25l0r****",
        "SecurityGroupId": "sg-25zwc****",
        "ZoneId": "cn-beijing-b",
        "MaxAmount": 1,
        "MinAmount": 1
      }
    }
  },
  "Outputs": {
    "InstanceIds": {
      "Value": {"get_attr": ["WebServer","InstanceIds"]}
    },
    "PublicIps": {
      "Value": {"get_attr": ["WebServer","PublicIps"]}
    }
  }
}