All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::InstanceGroupClone

Last Updated:Feb 06, 2026

ALIYUN::ECS::InstanceGroupClone clones a group of ECS instances.

Syntax

 {
  "Type": "ALIYUN::ECS::InstanceGroupClone",
  "Properties": {
    "BackendServerWeight": Integer,
    "SystemDiskAutoSnapshotPolicyId": String,
    "DiskMappings": List,
    "Period": Number,
    "LaunchTemplateName": String,
    "RamRoleName": 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,
    "PasswordInherit": Boolean,
    "MaxAmount": Integer,
    "AutoReleaseTime": String,
    "SystemDiskCategory": String,
    "LoadBalancerIdToAttach": String,
    "LaunchTemplateId": String,
    "LaunchTemplateVersion": String,
    "ZoneId": String,
    "InternetMaxBandwidthOut": Integer,
    "InstanceName": String,
    "DeletionProtection": Boolean,
    "DeploymentSetId": String,
    "Ipv6AddressCount": Integer,
    "SecurityGroupId": String,
    "SecurityGroupIds": List,
    "SpotPriceLimit": String,
    "HpcClusterId": String,
    "SystemDiskDescription": String,
    "Ipv6Addresses": List,
    "SystemDiskProvisionedIops": Integer,
    "SystemDiskBurstingEnabled": Boolean,
    "SystemDiskKMSKeyId": String,
    "SystemDiskStorageClusterId": String,
    "InternetMaxBandwidthIn": Integer,
    "UpdatePolicy": String,
    "SystemDiskEncryptAlgorithm": String,
    "SystemDiskEncrypted": String,
    "SecurityOptions": Map,
    "ImageOptions": Map,
    "NetworkOptions": Map,
    "HostNames": List,
    "NetworkInterfaceQueueNumber": Integer,
    "UniqueSuffix": Boolean,
    "CpuOptions": Map
  }
}

Properties

Property name

Type

Required

Update allowed

Description

Constraints

MaxAmount

Integer

Yes

Yes

The number of ECS instances to create at a time.

Valid values: 1 to 100.

SourceInstanceId

String

Yes

No

The ID of the ECS instance to clone.

The instance type, image, bandwidth billing method, bandwidth limit, and network type are cloned. If the source ECS instance is added to multiple security groups, the new instance is added to the first security group of the source instance.

AutoReleaseTime

String

No

No

The time when the new ECS instance is automatically released.

The time must be in the ISO 8601 format. For example: yyyy-MM-ddTHH:mm:ssZ. The release time cannot be more than three years in the future.

AutoRenew

String

No

Yes

Specifies whether to enable auto-renewal.

Valid values:

  • True: Enables auto-renewal.

  • False (default): Disables auto-renewal.

This parameter is required when InstanceChargeType is set to PrePaid.

AutoRenewPeriod

Number

No

Yes

The auto-renewal duration.

This parameter is required when AutoRenew is set to true.

Valid values:

  • 1 (default)

  • 2

  • 3

  • 6

  • 12

BackendServerWeight

Integer

No

No

The weight of the new ECS instance in the SLB instance.

Valid values: 0 to 100.

Default value: 100.

DeletionProtection

Boolean

No

No

The release protection attribute of the new instance. It specifies whether the instance can be released through the console or by calling the DeleteInstance API operation.

Valid values:

  • true: Indicates support.

  • false: This is not supported.

DeploymentSetId

String

No

Yes

The ID of the deployment set.

None

Description

String

No

Yes

The description.

A maximum of 256 characters.

DiskMappings

List

No

Yes

The disks to attach.

A maximum of 16 disks are supported.

For more information, see DiskMappings properties.

EniMappings

List

No

Yes

The ENIs to attach to the instance.

A maximum of one ENI can be attached to the instance.

For more information, see EniMappings properties.

HpcClusterId

String

No

Yes

The ID of the Elastic High Performance Computing (EHPC) cluster to which the new instance belongs.

None

ImageId

String

No

Yes

The ID of the image used to start the ECS instance. This can be a public image, custom image, or Alibaba Cloud Marketplace image.

You can specify a public image ID using a fuzzy match. You do not need to specify a complete public image ID. For example:

  • If you specify ubuntu, ubuntu16_0402_64_20G_alibase_20170818.vhd is matched.

  • If you specify ubuntu_14, ubuntu_14_0405_64_20G_alibase_20170824.vhd is matched.

  • If you specify ubuntu*14*32, ubuntu_14_0405_32_40G_alibase_20170711.vhd is matched.

  • If you specify ubuntu_16_0402_32, ubuntu_16_0402_32_40G_alibase_20170711.vhd is matched.

InstanceName

String

No

Yes

The name of the new instance.

A maximum of 128 characters. It can contain letters, Chinese characters, digits, underscores (_), periods (.), and hyphens (-).

InternetMaxBandwidthOut

Integer

No

No

The maximum outbound public bandwidth.

Unit: Mbit/s.

Valid values:

  • 0 to 200 for pay-by-bandwidth.

  • 1 to 200 for pay-by-data-transfer.

Ipv6AddressCount

Integer

No

Yes

The number of randomly generated IPv6 addresses to assign to the ENI.

You cannot specify both Ipv6Addresses and Ipv6AddressCount.

Ipv6Addresses

List

No

Yes

One or more IPv6 addresses to assign to the ENI.

The list can contain a maximum of one address. Changes to this property do not affect existing instances. You cannot specify both Ipv6Addresses and Ipv6AddressCount.

KeyPairName

String

No

Yes

The name of the key pair to attach to the new ECS instance.

This parameter is ignored for Windows ECS instances. If you specify KeyPairName, the value of Password is still set for the instance, but password-based logon is disabled for the Linux system.

LaunchTemplateId

String

No

Yes

The ID of the launch template.

None

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 a version, the default version is used.

LoadBalancerIdToAttach

String

No

No

The ID of the SLB instance to which the new ECS instance will be added.

None

Password

String

No

Yes

The logon password of the new ECS instance.

The password must be 8 to 30 characters in length. It must contain letters, digits, and special characters. Supported special characters: ()`~!@#$%^&*-_+=|{}[]:;'<>,.?/.

If you specify this parameter, use the HTTPS protocol to call the API to prevent password leakage.

PasswordInherit

Boolean

No

No

Specifies whether to use the preset password of the image.

Valid values:

  • true: Use the preset password.

  • false: Do not use the preset password.

Note

When you use this parameter, the Password parameter must be empty. You must also ensure that a password is set for the image.

Period

Number

No

Yes

The billing cycle.

Valid values: 1 to 9, 12, 24, 36, 48, and 60.

Unit: month.

This parameter is required when InstanceChargeType is set to PrePaid. This parameter is optional when InstanceChargeType is set to PostPaid.

PeriodUnit

String

No

Yes

The duration for which you purchase the resource.

Valid values:

  • Week

    If PeriodUnit is set to Week, valid values for Period are 1, 2, 3, and 4. Valid values for AutoRenewPeriod are 1, 2, and 3.

  • Month (default)

    If PeriodUnit is set to Month, valid values for Period are 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60. Valid values for AutoRenewPeriod are 1, 2, 3, 6, and 12.

RamRoleName

String

No

Yes

The name of the instance RAM role for the new instance.

You can call ListRoles to query the instance RAM role name. For more information, see Create a role and Obtain a list of roles.

ResourceGroupId

String

No

No

The ID of the resource group to which the new instance belongs.

None

SecurityGroupId

String

No

No

The security group to which the new instance belongs.

You cannot specify both SecurityGroupId and SecurityGroupIds.

SecurityGroupIds

List

No

No

A list of security groups to which the new instance belongs.

For more information, see Security groups.

You cannot specify both SecurityGroupId and SecurityGroupIds.

SpotPriceLimit

String

No

No

The maximum hourly price for the new instance.

It can have up to three decimal places. SpotPriceLimit takes effect when SpotStrategy is set to SpotWithPriceLimit.

SpotStrategy

String

No

Yes

The bidding policy for the pay-as-you-go instance.

This parameter is required when InstanceChargeType is set to PostPaid.

Valid values:

  • NoSpot (default): A regular pay-as-you-go instance.

  • SpotWithPriceLimit: A spot instance with a user-defined maximum price.

  • SpotAsPriceGo: The system automatically places a bid at a price that does not exceed the pay-as-you-go price.

SystemDiskAutoSnapshotPolicyId

String

No

Yes

The ID of the automatic snapshot policy for the system disk.

None

SystemDiskBurstingEnabled

Boolean

No

Yes

Specifies whether to enable bursting for the system disk.

Valid values:

  • true: Enable.

  • false (default): Disable.

SystemDiskCategory

String

No

Yes

The type of the system disk.

Valid values:

  • Cloud: Basic disk

  • cloud_efficiency (default): ultra disk.

  • cloud_ssd: Standard SSD.

  • cloud_essd: Enterprise SSD.

SystemDiskDescription

String

No

Yes

The description of the system disk.

None

SystemDiskDiskName

String

No

Yes

The name of the system disk.

The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character. It cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), and hyphens (-).

SystemDiskProvisionedIops

Integer

No

Yes

The provisioned IOPS of the system disk.

None

Tags

List

No

Yes

The custom tags.

A maximum of 20 tags are supported. Format: [{"Key": "tagKey", "Value": "tagValue"},{"Key": "tagKey2", "Value": "tagValue2"}].

For more information, see Tags properties.

ZoneId

String

No

No

The ID of the zone.

None

DiskMappings syntax

"DiskMappings": [
  {
    "Category": String,
    "DiskName": String,
    "Description": String,
    "Encrypted": String,
    "KMSKeyId": String,
    "Device": String,
    "SnapshotId": String,
    "Size": String,
    "PerformanceLevel": String,
    "AutoSnapshotPolicyId": String,
    "ProvisionedIops": Integer,
    "BurstingEnabled": Boolean,
    "StorageClusterId": String
  }
]

DiskMappings properties

Property Name

Type

Required

Update allowed

Description

Constraints

Size

String

Yes.

No

The size of the data disk.

Unit: GB.

AutoSnapshotPolicyId

String

No

No

The ID of the automatic snapshot policy.

None

BurstingEnabled

Boolean

No

No

Specifies whether to enable bursting.

Valid values:

  • true: Enable.

  • false (default): Disable.

Category

String

No

No

The type of the data disk.

Valid values:

  • cloud (default): basic disk.

  • cloud_ssd: Standard SSD.

  • cloud_essd: enterprise SSD.

  • cloud_efficiency: ultra disk.

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 name of the data disk in the ECS instance.

Example: /dev/xvd[a-z].

DiskName

String

No

No

The name of the data disk.

A maximum of 128 characters. It can contain letters, Chinese characters, digits, underscores (_), periods (.), and hyphens (-).

Encrypted

String

No

No

Specifies whether to encrypt the data disk.

Valid values:

  • true: Encrypt.

  • false (default): Do not encrypt.

KMSKeyId

String

No

No

The ID of the KMS key for the data disk.

None

PerformanceLevel

String

No

No

When you create an enterprise SSD to use as a system disk, set the performance level of the disk.

Valid values:

  • PL0: A single disk delivers up to 10,000 random read/write IOPS.

  • PL1 (default): A single disk delivers up to 50,000 random read/write IOPS.

  • PL2: A single disk delivers up to 100,000 random read/write IOPS.

  • PL3: A single disk delivers up to 1,000,000 random read/write IOPS.

For information about how to select an ESSD performance level, see Enterprise SSDs.

ProvisionedIops

Integer

No

No

The provisioned IOPS.

None

SnapshotId

String

No

No

The ID of the snapshot.

None

StorageClusterId

String

No

No

The ID of the dedicated block storage cluster.

None

EniMappings syntax

"EniMappings": [
  {
    "SecurityGroupId": String,
    "VSwitchId": String,
    "Description": String,
    "NetworkInterfaceName": String,
    "PrimaryIpAddress": String,    
    "InstanceType": String,
    "Ipv6AddressCount": Integer,
    "NetworkInterfaceTrafficMode": String,
    "Ipv6Addresses": List,
    "QueueNumber": Integer,
    "SecurityGroupIds": List,
    "QueuePairNumber": Integer,
    "NetworkInterfaceId": String,
    "DeleteOnRelease": Boolean,
    "NetworkCardIndex": Integer
  }
]

EniMappings properties

Property Name

Type

Required

Update allowed

Description

Constraints

SecurityGroupId

String

No

Yes

The ID of the security group.

The security group must be in the same VPC.

VSwitchId

String

No

No

The ID of the vSwitch.

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.

The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character. It cannot start with http:// or https://. It can contain letters, Chinese characters, digits, colons (:), underscores (_), and hyphens (-).

PrimaryIpAddress

String

No

No

The primary private IP address of the ENI.

The specified IP address must be an idle IP address within the CIDR block of the vSwitch.

If you do not specify an IP address, an idle IP address is randomly assigned from the vSwitch.

InstanceType

String

No

No

The type of the ENI.

You can set a maximum of two NICs. When you set one ENI, you can set it as a primary NIC or a secondary ENI. When you set two ENIs, you can only set one as a primary NIC and the other as a secondary ENI.

Valid values:

  • Primary: primary NIC.

  • Secondary (default): secondary ENI.

Ipv6AddressCount

Integer

No

No

The number of randomly generated IPv6 addresses to assign to the primary NIC.

Valid values: 1 to 10.

Notes:

  • This parameter takes effect only when NetworkInterface.InstanceType is set to Primary. If NetworkInterface.InstanceType is set to Secondary or is empty, you cannot set this parameter.

  • After you set this parameter, you cannot set Ipv6AddressCount, Ipv6Address, or NetworkInterface.Ipv6Address.

NetworkInterfaceTrafficMode

String

No

No

The communication mode of the NIC.

Valid values:

  • Standard (default): Uses the TCP communication mode.

  • HighPerformance: Enables the Elastic RDMA Interface (ERI) and uses the RDMA communication mode.

Note

The number of ENIs in RDMA mode cannot exceed the limit for the instance family. For more information, see Instance families.

Ipv6Addresses

List

No

No

One or more IPv6 addresses to assign to the primary NIC.

You can set a maximum of 10 IPv6 addresses.

Notes:

  • This parameter takes effect only when NetworkInterface.InstanceType is set to Primary. If NetworkInterface.InstanceType is set to Secondary or is empty, you cannot set this parameter.

  • After you set this parameter, the value of Amount can only be 1, and you cannot set Ipv6AddressCount, Ipv6Address.N, or NetworkInterface.N.Ipv6AddressCount.

QueueNumber

Integer

No

No

The number of queues for the ENI.

Notes:

  • Valid values: 1 to 2. When you set one ENI, you can set it as a primary NIC or a secondary ENI. When you set two ENIs, you can only set one as a primary NIC and the other as a secondary ENI.

  • The value cannot exceed the maximum number of queues per NIC allowed for the instance type.

  • The total number of queues for all NICs of the instance cannot exceed the total queue quota for the instance type. You can call the DescribeInstanceTypes operation and check the MaximumQueueNumberPerEni and TotalEniQueueQuantity fields to query the maximum number of queues per NIC and the total queue quota for an instance type.

  • If NetworkInterface.InstanceType is set to Primary and you set this parameter, you cannot set the NetworkInterfaceQueueNumber parameter.

SecurityGroupIds

List

No

No

One or more security group IDs to which the ENI belongs.

Notes:

  • If NetworkInterface.N.InstanceType is set to Primary, you must set this parameter or NetworkInterface.SecurityGroupId. In this case, this parameter has the same effect as SecurityGroupIds. However, you cannot set SecurityGroupId, SecurityGroupIds, or NetworkInterface.SecurityGroupId.

  • If NetworkInterface.N.InstanceType is set to Secondary or is empty, this parameter is optional. The default value is the security group to which the ECS instance belongs.

QueuePairNumber

Integer

No

No

The number of queues for the RDMA NIC.

This field is of the Long type. Precision may be lost during serialization or deserialization. The value cannot be greater than 9007199254740991.

NetworkInterfaceId

String

No

No

The ID of the ENI to attach to the instance.

This parameter is effective only for secondary ENIs. After you specify an existing secondary ENI, you cannot configure creation parameters for other NICs.

DeleteOnRelease

Boolean

No

No

Specifies whether to retain the NIC when the instance is released

Valid values:

  • true: Do not retain.

  • false: Retain.

NetworkCardIndex

Integer

No

No

The index of the physical NIC specified for the NIC.

  • Only specific instance types support specifying a physical NIC index.

  • If NetworkInterface.N.InstanceType is set to Primary, for instance types that support physical NICs, this parameter can only be set to 0.

  • If NetworkInterface.N.InstanceType is set to Secondary or is empty, for instance types that support physical NICs, this parameter can be set based on the instance type. For more information, see Instance families.

SecurityOptions syntax

"SecurityOptions": {
  "TrustedSystemMode": String
}

SecurityOptions properties

Property Name

Type

Required

Update allowed

Description

Constraints

TrustedSystemMode

String

No

No

The trusted system mode.

Valid value: vTPM. Currently, the trusted system mode is supported by the following instance families: g7, c7, and r7. It is also supported by security-enhanced instance families: g7t, c7t, and r7t. When you create an ECS instance of these instance families, you must set this parameter. Details are as follows:

If you use the Alibaba Cloud Trusted System, set this parameter to vTPM. When the instance starts, the Alibaba Cloud Trusted System completes the trusted verification. If you do not use the Alibaba Cloud Trusted System, you can leave this parameter empty. However, if the ECS instance you create uses the enclave confidential computing mode (SecurityOptions.ConfidentialComputingMode=Enclave), the trusted system is also enabled for the ECS instance. To create an ECS instance with a trusted system using an OpenAPI, you can only call RunInstances. CreateInstance does not currently support setting the SecurityOptions.TrustedSystemMode parameter.

Note

If you specify the instance as a trusted instance when you create it, you can only use images that support the trusted system when you replace the system disk.

ImageOptions syntax

"ImageOptions": {
  "LoginAsNonRoot": Boolean
}

ImageOptions properties

Property name

Type

Required

Update allowed

Description

Constraints

LoginAsNonRoot

Boolean

No

No

Specifies whether instances that use this image support logon as the ecs-user user.

Valid values:

  • true: Yes.

  • false: No.

CpuOptions syntax

"CpuOptions": {
  "ThreadsPerCore": Integer,
  "Core": Integer
}

CpuOptions properties

Property Name

Type

Required

Update allowed

Description

Constraints

ThreadsPerCore

Integer

No

No

The number of CPU threads.

The number of vCPUs of an ECS instance = CpuOptions.Core value × CpuOptions.ThreadsPerCore value.

Core

Integer

No

No

The number of CPU cores.

This parameter cannot be customized and can only be set to the default value.

Default value: For more information, see Change CPU options.

NetworkOptions syntax

"NetworkOptions": {
  "EnableJumboFrame": Boolean
}

NetworkOptions properties

Property Name

Type

Required

Update allowed

Description

Constraints

EnableJumboFrame

Boolean

No

No

Specifies whether to enable the jumbo frame feature for the instance.

Parameter values:

  • false: Disables the jumbo frame feature. The MTU of all NICs (including primary and secondary NICs) on the instance is 1500.

  • true (default): Enables the jumbo frame feature. The MTU of all NICs (including primary and secondary NICs) on the instance is 8500.

Note

Only some instance types of generation 8 or later support enabling the jumbo frame feature. For more information, see Jumbo frames.

Tags syntax

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

Tags properties

Property Name

Type

Required

Update allowed

Description

Constraints

Key

String

Yes

No

The tag key.

The key must be 1 to 128 characters in length. It cannot start with aliyun or acs:. It cannot contain http:// or https://.

Value

String

No

No

The tag value.

The value can be 0 to 128 characters in length. It cannot start with aliyun or acs:. It cannot contain http:// or https://.

Return value

Fn::GetAtt

  • InstanceIds: The ID of the new instance. It is a system-generated, globally unique identifier used to access the instance.

  • PrivateIps: A list of private IP addresses of the instances in the VPC. This parameter is returned only when NetworkType is set to vpc. The value is a JSON array of strings, such as ["172.16.XX.XX", "172.16.XX.XX", ..., "172.16.XX.XX"].

  • InnerIps: A list of private IP addresses of the instances in the classic network. This parameter is returned only when NetworkType is set to classic. The value is a JSON array of strings, such as ["10.1.XX.XX", "10.1.XX.XX", ..., "10.1.XX.XX"].

  • PublicIps: A list of public IP addresses of the instances in the classic network. This parameter is returned only when NetworkType is set to classic. The value is a JSON array of strings, such as ["42.1.XX.XX", "42.1.XX.XX", ..., "42.1.XX.XX"].

  • HostNames: A list of hostnames for the new instances.

  • OrderId: The list of order IDs for the new instances.

  • ZoneIds: The IDs of the zones in which the instances are created.

  • RelatedOrderIds: The IDs of related orders for the created ECS instances.

  • Ipv6AddressIds: A list of IPv6 address IDs for the cloned ECS instances. Note: The value is a two-dimensional list. If an instance does not have an IPv6 address, the corresponding element in the list is empty. If none of the instances have an IPv6 address, this parameter is null.

  • Ipv6Addresses: A list of IPv6 addresses for the cloned ECS instances. Note: The value is a two-dimensional list. If an instance does not have an IPv6 address, the corresponding element in the list is null. If none of the instances have an IPv6 address, this parameter is null.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Description: Clones a group of ECS instances with the same configuration as an existing ECS instance. This includes the instance type, image ID, Internet billing method, maximum outbound public bandwidth, system disk and data disk configurations, and VPC properties. You only need to specify the SourceInstanceId.
Parameters:
  SourceInstanceId:
    Type: String
    Description: The ID of the source ECS instance to clone.
    Label: Source Instance ID
  InstanceName:
    Type: String
    Description: 'The instance name. The name must be 2 to 128 characters in length. It can contain letters, Chinese characters, digits, underscores (_), periods (.), and hyphens (-).'
    ConstraintDescription: '[2, 128] characters, consists of uppercase letter, lowercase letter, number or special characters.'
    Label: Instance Name
    Default: ClonedECS
    MaxLength: 128
    MinLength: 2
  MaxAmount:
    Type: Number
    Description: The maximum number of ECS instances to create at a time. This value must be greater than or equal to the minimum number of ECS instances to create.
    ConstraintDescription: An integer from 1 to 100.
    Label: Maximum Number of ECS Instances
    MaxValue: 100
    MinValue: 1
    Default: 1
  Password:
    Type: String
    Description: 'The password must be 8 to 30 characters in length. It must contain three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; '' , . ? /'
    ConstraintDescription: 'The password must be 8 to 30 characters in length. It must contain three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ()`~!@#$%^*_-+=|{}[]:;'',.?/'
    Label: ECS Instance Password
    MaxLength: 30
    MinLength: 8
    AllowedPattern: '[a-zA-Z0-9-\(\)\`\~\!@\#\$%\^\*-+=\|\{\}\[\]\:\;\‘\,\.\?\/]*'
    NoEcho: true
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - InstanceName
          - SourceInstanceId
          - MaxAmount
          - Password
        Label:
          default: ECS
    TemplateTags:
      - 'acs:example:Elastic Computing:Specify SourceInstanceId to clone a group of ECS instances with the same configuration.'
Resources:
  ECSInstanceGroup:
    Type: ALIYUN::ECS::InstanceGroupClone
    Properties:
      SourceInstanceId:
        Ref: SourceInstanceId
      MaxAmount:
        Ref: MaxAmount
      Password:
        Ref: Password
Outputs:
  InstanceIds:
    Description: The instance ID list of created ecs instance
    Value:
      Fn::GetAtt:
        - ECSInstanceGroup
        - InstanceIds
  PublicIps:
    Description: Public IP address list of created ecs instance.
    Value:
      Fn::GetAtt:
        - ECSInstanceGroup
        - PublicIps
  ZoneIds:
    Description: Zone ID of created instance.
    Value:
      Fn::GetAtt:
        - ECSInstanceGroup
        - ZoneIds
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Clones a group of ECS instances with the same configuration as an existing ECS instance. This includes the instance type, image ID, Internet billing method, maximum outbound public bandwidth, system disk and data disk configurations, and VPC properties. You only need to specify the SourceInstanceId.",
  "Parameters": {
    "SourceInstanceId": {
      "Type": "String",
      "Description": "The ID of the source ECS instance to clone",
      "Label": "Source Instance ID"
    },
    "InstanceName": {
      "Type": "String",
      "Description": "The instance name. The name must be 2 to 128 characters in length. It can contain letters, Chinese characters, digits, underscores (_), periods (.), and hyphens (-).",
      "ConstraintDescription": "[2, 128] characters, consists of uppercase letter, lowercase letter, number or special characters.",
      "Label": "Instance Name",
      "Default": "ClonedECS",
      "MaxLength": 128,
      "MinLength": 2
    },
    "MaxAmount": {
      "Type": "Number",
      "Description": "The maximum number of ECS instances to create at a time. This value must be greater than or equal to the minimum number of ECS instances to create.",
      "ConstraintDescription": "An integer from 1 to 100",
      "Label": "Maximum Number of ECS Instances",
      "MaxValue": 100,
      "MinValue": 1,
      "Default": 1
    },
    "Password": {
      "Type": "String",
      "Description": "The password must be 8 to 30 characters in length. It must contain three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? / ",
      "ConstraintDescription": "The password must be 8 to 30 characters in length. It must contain three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ()`~!@#$%^*_-+=|{}[]:;',.?/",
      "Label": "ECS Instance Password",
      "MaxLength": 30,
      "MinLength": 8,
      "AllowedPattern": "[a-zA-Z0-9-\\(\\)\\`\\~\\!@\\#\\$%\\^\\*-+=\\|\\{\\}\\[\\]\\:\\;\\‘\\,\\.\\?\\/]*",
      "NoEcho": true
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "InstanceName",
            "SourceInstanceId",
            "MaxAmount",
            "Password"
          ],
          "Label": {
            "default": "ECS"
          }
        }
      ],
      "TemplateTags": [
        "acs:example:Elastic Computing:Specify SourceInstanceId to clone a group of ECS instances with the same configuration."
      ]
    }
  },
  "Resources": {
    "ECSInstanceGroup": {
      "Type": "ALIYUN::ECS::InstanceGroupClone",
      "Properties": {
        "SourceInstanceId": {
          "Ref": "SourceInstanceId"
        },
        "MaxAmount": {
          "Ref": "MaxAmount"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "InstanceIds": {
      "Description": "The instance ID list of created ecs instance",
      "Value": {
        "Fn::GetAtt": [
          "ECSInstanceGroup",
          "InstanceIds"
        ]
      }
    },
    "PublicIps": {
      "Description": "Public IP address list of created ecs instance.",
      "Value": {
        "Fn::GetAtt": [
          "ECSInstanceGroup",
          "PublicIps"
        ]
      }
    },
    "ZoneIds": {
      "Description": "Zone ID of created instance.",
      "Value": {
        "Fn::GetAtt": [
          "ECSInstanceGroup",
          "ZoneIds"
        ]
      }
    }
  }
}