edit-icon download-icon

ALIYUN::ECS::InstanceGroup

Last Updated: Jun 13, 2018

The ALIYUN::ECS::InstanceGroup type is used to create a set of ECS instances.

Syntax

  1. {
  2. "Type" : "ALIYUN::ECS::InstanceGroup",
  3. "Properties" : {
  4. "SecurityGroupId" : String,
  5. "ImageId" : String,
  6. "InstanceType" : String,
  7. "InstanceName" : String,
  8. "Description" : String,
  9. "HostName" : String,
  10. "Password" : String,
  11. "IoOptimized" : String,
  12. "ZoneId" : String,
  13. "InternetChargeType" : String,
  14. "InternetMaxBandwidthIn" : Integer,
  15. "InternetMaxBandwidthOut" : Integer,
  16. "VpcId" : String,
  17. "VSwitchId" : String,
  18. "MaxAmount" : Integer,
  19. "MixAmount" : Integer,
  20. "AllocatePublicIP" : Boolean,
  21. "AutoReleaseTime" : String,
  22. "DiskMappings" : List,
  23. "NetworkType" : String,
  24. "PrivateIpAddress" : String,
  25. "SystemDiskCategory" : String,
  26. "SystemDiskDescription" : String,
  27. "SystemDiskDiskName" : String,
  28. "SystemDiskSize" : Integer,
  29. "Tags" : String,
  30. "UserData" : String,
  31. "KeyPairName": String
  32. }
  33. }

Attributes

Attribute name Type Required Update allowed Description Constraint
MaxAmountstringYesYesMaximum number of ECS instances that can be created at a time.Value range: [1, 100]. The value of MaxAmount must be greater than or equal to that of MinAmount.
MinAmountstringYesYesMinimum number of ECS instances that must be created at a time.Value range: [1, 100]. The value of MinAmount must be smaller than or equal to that of MaxAmount.
DescriptionstringNoNoDescription.The maximum length is 256 characters.
InstanceTypestringYesNoECS instance type.Instance generations and type families.
ImageIdstringYesYesID of the image used to start the ECS instances. The image can be a public image, custom image, or a marketplace image.ECS public image list.
You can specify a public image ID in a fuzzy manner. Generally, to deploy an ECS instance, specify the image type and version or specify only the image type when editing a template. ROS automatically selects a proper public image ID. And when you specify an image ID, you can replace some part of the image ID with the wildcard character asterisk (*).
Take all Ubuntu public images provided in Alibaba Cloud as an example:
ubuntu14_0405_32_40G_alibase_20170711.vhd
ubuntu_14_0405_32_40G_alibase_20170711.vhd
ubuntu_14_0405_64_20G_alibase_20170824.vhd
ubuntu_16_0402_32_40G_alibase_20170711.vhd
ubuntu_16_0402_64_20G_alibase_20170818.vhd
To specify the public image ID for ECS instances, you can
Specify: ubuntu
Match: ubuntu_16_0402_64_20G_alibase_20170818.vhd
Specify: ubuntu_14
Match: ubuntu_14_0405_64_20G_alibase_20170824.vhd
Specify: ubuntu1432
Match: ubuntu_14_0405_32_40G_alibase_20170711.vhd
Specify: ubuntu_16_0402_32
Match: ubuntu_16_0402_32_40G_alibase_20170711.vhd
SecurityGroupIdstringYesNoID of the security group to which the created instance belongs.N/A
InstanceNamestringNoNoInstance name. The instance name can contain a maximum of 128 characters including letters, numbers, periods(.), hyphens(-), and underscores().
PasswordstringNoNoECS instance logon password.The password is a string of 8-30 characters and must contain uppercase or lowercase letters, numbers, and special characters including ( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ‘ < > , . ? /. If the Password parameter is input, HTTPS method must be used when calling the APIs to prevent password leakage.
HostNamestringNoNoHost name.This parameter indicates the host name of an ECS instance. It is a string of at least two characters. A host name cannot start or end with a period(.) or a hyphen(-). In addition, consecutive periods(.) or hyphens(-) are not allowed. In Windows, a host name can contain a maximum of 15 characters including uppercase or lowercase letters, numbers, and hyphens(-). It cannot contain only periods (.), or numbers. In other systems such as Linux, the host name can contain a maximum of 30 characters which can be separated by periods(.) into segments, and each segment can contain uppercase or lowercase letters, numbers, and underscores(_).
AllocatePublicIPbooleanNoNoWhether to create public IP addresses. This parameter is only valid for the Classic network type. No public IP addresses are assigned if InternetMaxBandwidthOut is set to 0.The default value is “true”.
AutoReleaseTimestringNoNoAutomatic ECS instance release time.The time format follows the ISO8601 standard, for example, “yyyy-MM-ddTHH:mm:ssZ”. The maximum release time is three years.
PrivateIpAddressstringNoNoInternal IP address in VPC. The IP address cannot be the same as the IP addresses of other instances in VPC.N/A
DiskMappingslistNoNoData disks created for the ECS instances.N/A
InternetChargeTypestringNoNoBandwidth billing method for access over the Internet. Default value: PayByTraffic.Value options: PayByBandwidth and PayByTraffic. Default value: PayByTraffic.
InternetMaxBandwidthInintegerNoNoMaximum Internet inbound bandwidth, in Mbps.Value range: [1, 100]; default value: 100.
InternetMaxBandwidthOutintegerNoNoMaximum Internet outbound bandwidth, in Mbps.Value range in PayByBandwidth mode: [0, 200]; default value: 0. Value range in PayByTraffic mode: [1, 200]. This parameter must be specified in PayByTraffic mode.
IoOptimizedstringNoNoWhether to create an I/O optimized instance.Value options: none (non-I/O optimized) and optimized (I/O optimized); default value: none.
DiskMappingslistNoNoThe disk you want to attach.Up to four disks can be attached.
SystemDiskCategorystringNoNoSystem disk type.Value options: cloud, cloud_efficiency, cloud_ssd, and ephemeral_ssd.
SystemDiskDescriptionstringNoNoSystem disk description.N/A
SystemDiskDiskNamestringNoNoSystem disk name.N/A
SystemDiskSizestringNoYesSystem disk size.Value range: [40, 500] GB. If a custom image is used to create a system disk, make sure that the system disk size is greater than the image size.
TagslistNoNoCustom tag.Up to four tags are supported, in the format of [{“Key”:”tagKey”,”Value”:”tagValue”},{“Key”:”tagKey2”,”Value”:”tagValue2”}].
UserDatastringNoNoUser data that is input during ECS instance creation.The user data size cannot exceed 16 KB.
ZoneIdstringNoNoZone ID.N/A
VpcIdstringNoNoVPC ID.N/A
VSwitchIdstringNoNoVSwitch ID.N/A
NetworktypestringNoNoNetwork type of the ECS instances.Value options: VPC and Classic.
KeyPairNamestringNoNo Name of the key pair bound to the ECS instance. This parameter is ignored if the key pair is bound to a Windows ECS instance. It is null by default. If this parameter is set, the value of the Password parameter is set to the instance. However, the password logon mode in Linux is disabled. N/A

DiskMappings syntax

  1. "DiskMappings" : [
  2. {
  3. "Category" : String,
  4. "DiskName" : String,
  5. "Description" : String,
  6. "Device" : String,
  7. "SnapshotId" : String,
  8. "Size" : String
  9. }
  10. ]

DiskMappings attributes

Attribute name Type Required Update allowed Description Constraint
Size string Yes No Data disk size, in GB. N/A
Category string No No Data disk type. Value options: cloud, cloudefficiency, cloud_ssd, and ephemeral_ssdDefault.
DiskName string No No Data disk name. The data disk name can contain a maximum of 128 characters including letters, numbers, periods(.), hyphens(-), and underscores(_).
Description string No No Description. Value range: [2, 256]; default value: null.
Device string No No Device name of the data disk in the ECS instance. Example: /dev/xvd[a-z].
SnapshotId string No No ID of the snapshot used to create the data disk. N/A

Tags syntax

  1. "Tags" : [
  2. {
  3. "Value" : String,
  4. "Key" : String
  5. }
  6. ]

Tags attributes

Attribute name Type Required Update allowed Description Constraint
Key string Yes No N/A N/A
Value string No No N/A N/A

Return values

Fn::GetAtt

  • InstanceIds: IDs of the instances generated by the system and are globally unique. It is a unique identifier of the instance.

  • PrivateIps: list of the private IP addresses of VPC type instances. This parameter is effective when NetworkType is VPC. It is a JSON array of [“172.16.1.1”, “172.16.2.1”, … “172.16.10.1”]. It can contain a maximum of 100 IP addresses, which are separated by commas(,).

  • InnerIps: list of the private IP addresses of Classic type instances. This parameter is effective when NetworkType is Classic. It is a JSON array of [“10.1.1.1”, “10.1.2.1”, … “10.1.10.1”]. It can contain a maximum of 100 IP addresses, which are separated by commas(,).

  • PublicIps: list of the public IP addresses of Classic type instances. This parameter is effective when NetworkType is Classic. It is a JSON array of [“42.1.1.1”, “42.1.2.1”, … “42.1.10.1”]. It can contain a maximum of 100 IP addresses, which are separated by commas(,).

  • ZoneId: zone ID.

Example

  1. {
  2. "ROSTemplateFormatVersion" : "2015-09-01",
  3. "Resources" : {
  4. "WebServer": {
  5. "Type": "ALIYUN::ECS::InstanceGroup",
  6. "Properties": {
  7. "ImageId" : "m-25l0rcfjo",
  8. "InstanceType": "ecs.t1.small",
  9. "SecurityGroupId": "sg-25zwc3se0",
  10. "ZoneId": "cn-beijing-b",
  11. "MaxAmount" : 1,
  12. "MinAmount" : 1,
  13. "Tags": [{
  14. "Key": "tiantt",
  15. "Value": "ros"
  16. },{
  17. "Key": "tiantt1",
  18. "Value": "ros1"
  19. }
  20. ]
  21. }
  22. }
  23. },
  24. "Outputs": {
  25. "InstanceIds": {
  26. "Value" : {"get_attr": ["WebServer","InstanceIds"]}
  27. },
  28. "PublicIps": {
  29. "Value" : {"get_attr": ["WebServer","PublicIps"]}
  30. }
  31. }
  32. }
Thank you! We've received your feedback.