ALIYUN::ECS::InstanceGroup is used to create an ECS instance group.

Syntax

{
  "Type": "ALIYUN::ECS::InstanceGroup",
  "Properties": {
    "DedicatedHostId": String,
    "LaunchTemplateName": String,
    "RamRoleName": String,
    "IoOptimized": String,
    "InternetChargeType": String,
    "PrivateIpAddress": String,
    "KeyPairName": String,
    "SystemDiskDiskName": String,
    "PeriodUnit": String,
    "Description": String,
    "AutoRenew": String,
    "SpotPriceLimit": String,
    "HostName": String,
    "AutoRenewPeriod": Number,
    "ImageId": String,
    "ResourceGroupId": String,
    "InstanceChargeType": String,
    "VSwitchId": String,
    "EniMappings": List,
    "Password": String,
    "InstanceType": String,
    "MaxAmount": Integer,
    "AutoReleaseTime": String,
    "Tags": List,
    "SystemDiskCategory": String,
    "DeletionProtection": Boolean,
    "LaunchTemplateId": String,
    "LaunchTemplateVersion": String,
    "SystemDiskSize": Number,
    "ZoneId": String,
    "InternetMaxBandwidthOut": Integer,
    "VpcId": String,
    "SpotStrategy": String,
    "InstanceName": String,
    "InternetMaxBandwidthIn": Integer,
    "UserData": String,
    "DeploymentSetId": String,
    "SecurityGroupId": String,
    "Period": Number,
    "HpcClusterId": String,
    "AllocatePublicIP": Boolean,
    "SystemDiskDescription": String,
    "NetworkType": String,
    "DiskMappings": List,
    "Ipv6AddressCount": Integer,
    "Ipv6Addresses": List,
    "SystemDiskAutoSnapshotPolicyId": String
  }
}

Properties

Name Type Required Editable Description Validity
ResourceGroupId String No Yes The ID of the enterprise resource group to which created instances belong. None
HpcClusterId String No Yes The ID of the HPC cluster to which created instances belong. None
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.
Description String No No The description of created instances. The description can be up to 256 characters in length.
InstanceType String Yes No The type of created ECS instances. For more information, see Instance families.
ImageId String Yes 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.
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 (-). Instance names must be in the name_prefix[begin_number,bits]name_suffix format. For more information, see Request parameters.
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.

HostName String No No The hostname of created ECS instances. The hostname must contain at least two characters in length. It cannot start or end with a period (.) or hyphen (-). It cannot contain consecutive periods (.) or hyphens (-). For more information, see Request parameters.
AllocatePublicIP Boolean No No Specifies whether to allocate a public IP address to an ECS instance. If the InternetMaxBandwidthOut parameter is set to 0, no public IP addresses will be allocated. Default value: true.
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.
PrivateIpAddress String No No The private IP address of an ECS instance in a VPC. The specified IP address must not be used by other instances in the VPC.
DiskMappings List No No The data disks to be attached to created instances. None
InternetChargeType String No No The billing method for network usage. Valid values: PayByBandwidth and PayByTraffic. Default value: PayByTraffic.
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.
InternetMaxBandwidthOut Integer No No The maximum bandwidth of the outbound traffic to the Internet. Unit: Mbit/s. Valid values: 0 to 100. Default value: 0.
IoOptimized String No No Specifies whether the created instances are I/O optimized. Valid values: none and optimized. Default value: none.
SystemDiskCategory String No No The type of the system disk. Valid values: cloud, cloud_efficiency, cloud_ssd, cloud_essd, and ephemeral_ssd.
SystemDiskDescription String No No The description of the system disk. None
SystemDiskDiskName String No No The name of the system disk. None
SystemDiskSize Number No Yes The size of the system disk. Unit: GB. Valid values: 40 to 500. If a custom image is used to create a system disk, make sure that the size of the system disk is greater than that of the custom image.
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.
UserData String No No The user data that you provide when you create ECS instances. The user data can be up to 16 KB in size. You do not need to convert the data into Base64-encoded strings. If the data contains special characters, add a backslash (\) immediately before each special character.
ZoneId String No No The ID of the zone. None
VpcId String No No The ID of the VPC. None
VSwitchId String No No The ID of the VSwitch. 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. This parameter is empty by default. 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.
DedicatedHostId String No No The ID of the dedicated host. None
LaunchTemplateName String No No The name of the launch template. None
PeriodUnit String No No The unit of billing cycle for created instances. Valid values: Week and Month. Default value: Month.
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.
InstanceChargeType String No Yes The billing method of created instances. Default value: PostPaid. Valid values: PrePaid and PostPaid. Default value: PostPaid. If this parameter is set to PrePaid, you must ensure that your payment account has sufficient balance or credit. Otherwise, an InvalidPayMethod error will be returned.
EniMappings List No Yes The elastic network interfaces (ENIs) to be attached to created instances. Only one ENI can be attached to each instance.
LaunchTemplateId String No Yes The ID 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.
Period Number No Yes The billing cycle for created ECS instances. This parameter is required when the InstanceChargeType parameter is set to PrePaid. If the DedicatedHostId parameter is specified, the billing cycle for the instances must be shorter than that of the dedicated host. Valid values for the Period parameter when PeriodUnit is set to Week: 1, 2, 3, and 4. Valid values for the Period parameter when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60.
NetworkType String No No The network type of created ECS instances. Valid values: vpc and classic. Default value: classic.
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,
    "Device": String,
    "SnapshotId": String,
    "Size": String,
    "Encrypted": String,
    "KMSKeyId": 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 Yes The ID of the automatic snapshot policy. 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

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 an instance belongs. The security group and the instance must be in the same VPC.
VSwitchId String Yes 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 and 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 and can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.
PrimaryIpAddress String No No The primary private IP address of the ENI. The specified IP address must be available within the CIDR block of the VSwitch. If this parameter is not specified, an available IP address in the VSwitch CIDR block will be selected at random.

Response parameters

Fn::GetAtt

  • InstanceIds: the IDs of created 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 hostnames of all instances.
  • ZoneIds: the IDs of the zones where created instances reside.

Examples

{
  "ROSTemplateFormatVersion":"2015-09-01",
  "Resources":{
    "WebServer": {
      "Type": "ALIYUN::ECS::InstanceGroup",
      "Properties": {
        "ImageId":"m-25l0r****",
        "InstanceType": "ecs.t1.small",
        "SecurityGroupId": "sg-25zwc****",
        "ZoneId": "cn-beijing-b",
        "MaxAmount":1,
        "MinAmount":1,
        "Tags": [{
            "Key": "tiantt",
            "Value": "ros"
        },{
            "Key": "tiantt1",
            "Value": "ros1"
        }
        ]
      }
    }
  },
  "Outputs": {
    "InstanceIds": {
         "Value":{"get_attr": ["WebServer","InstanceIds"]}
    },
    "PublicIps": {
         "Value":{"get_attr": ["WebServer","PublicIps"]}
    }
  }
}