ALIYUN::ECS::LaunchTemplate
The ALIYUN::ECS::LaunchTemplate resource creates an ECS launch template.
Syntax
{
"Type": "ALIYUN::ECS::LaunchTemplate",
"Properties": {
"LaunchTemplateName": String,
"VersionDescription": String,
"ImageId": String,
"InstanceType": String,
"SecurityGroupId": String,
"NetworkType": String,
"VSwitchId": String,
"InstanceName": String,
"Description": String,
"InternetMaxBandwidthOut": Integer,
"HostName": String,
"ZoneId": String,
"SystemDiskCategory": String,
"SystemDiskSize": Number,
"SystemDiskDiskName": String,
"SystemDiskDescription": String,
"IoOptimized": String,
"InternetChargeType": String,
"UserData": String,
"KeyPairName": String,
"RamRoleName": String,
"AutoReleaseTime": String,
"SpotStrategy": String,
"SpotPriceLimit": String,
"SecurityEnhancementStrategy": String,
"DiskMappings": List,
"NetworkInterfaces": List,
"Tags": List,
"TemplateTags": List,
"TemplateResourceGroupId": String,
"SecurityGroupIds": List,
"ResourceGroupId": String,
"SpotDuration": Integer,
"ImageOwnerAlias": String,
"Period": Integer,
"Ipv6AddressCount": Integer,
"PrivateIpAddress": String,
"PasswordInherit": Boolean,
"SystemDiskDeleteWithInstance": Boolean,
"DeploymentSetId": String,
"InstanceChargeType": String,
"SystemDiskPerformanceLevel": String
}
}Properties
| Property | Type | Required | Update allowed | Description | Constraints |
| LaunchTemplateName | String | Yes | No | The name of the launch template. | 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 (-). |
| VersionDescription | String | No | No | The description of the launch template version. | The description 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://. |
| ImageId | String | No | No | The ID of the image. | None |
| InstanceType | String | No | No | The instance type. | None |
| SecurityGroupId | String | No | No | The ID of the security group. | None |
| NetworkType | String | No | No | The network type of the instance. | Valid values:
|
| VSwitchId | String | No | No | The ID of the vSwitch. | This parameter is valid only when NetworkType is set to vpc. |
| InstanceName | String | No | No | The name of the instance. | 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://. |
| Description | String | No | No | The description of the instance. | The description 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://. |
| InternetMaxBandwidthOut | Integer | No | No | The maximum outbound public bandwidth. | The value must be an integer from 0 to 100. Unit: Mbit/s. |
| HostName | String | No | No | The hostname of the instance. | A period (.) or a hyphen (-) cannot be used as the first or last character. These characters also cannot be used consecutively. Valid values:
|
| ZoneId | String | No | No | The ID of the zone where the instance is located. | None |
| SystemDiskCategory | String | No | No | The category of the system disk. | Valid values:
|
| SystemDiskSize | Number | No | No | The size of the system disk. | The value must be an integer from 20 to 500. Unit: GB. |
| SystemDiskDiskName | String | No | No | 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 letters, Chinese characters, digits, colons (:), underscores (_), and hyphens (-). |
| SystemDiskDescription | String | No | No | The description of the system disk. | The description must be 2 to 256 characters in length. It cannot start with http:// or https://. |
| IoOptimized | String | No | No | Specifies whether the instance is an I/O optimized instance. | Valid values:
|
| InternetChargeType | String | No | No | The billing method for network usage. | Valid values:
|
| UserData | String | No | No | User data for the instance. | The user data must be Base64-encoded. The raw data cannot exceed 16 KB. |
| KeyPairName | String | No | No | The name of the key pair. | This parameter is required only for Linux instances. If you specify this parameter, the password-based logon method is disabled. |
| RamRoleName | String | No | No | The name of the instance RAM role. | None |
| AutoReleaseTime | String | No | No | The automatic release time of the instance. | The time must be in the yyyy-MM-ddTHH:mm:ssZ format and in UTC. The time follows the ISO 8601 standard. |
| SpotStrategy | String | No | No | Specifies the preemption policy for pay-as-you-go instances. | This parameter is valid only when InstanceChargeType is set to PostPaid. Valid values:
|
| SpotPriceLimit | String | No | No | The maximum hourly price of the instance. | The value can have up to three decimal places. |
| SecurityEnhancementStrategy | String | No | No | Specifies whether to enable security hardening. | Valid values:
|
| DiskMappings | List | No | No | The list of data disks. | You can add up to 16 data disks. For more information, see the DiskMappings property. |
| NetworkInterfaces | List | No | No | The list of elastic network interfaces (ENIs). | You can add up to 8 ENIs. For more information, see the NetworkInterfaces property. |
| Tags | List | No | No | The list of tags for the instance, security group, disks, and ENIs. | You can add up to 20 tags. For more information, see the Tags property. |
| TemplateTags | List | No | No | The list of tags for the launch template. | You can add up to 20 tags. For more information, see the TemplateTags property. |
| TemplateResourceGroupId | String | No | No | The ID of the resource group to which the launch template belongs. | None |
| SecurityGroupIds | List | No | No | One or more security groups to which the instance belongs. | The number of security groups is determined by the quota. Note You cannot specify both SecurityGroupId and SecurityGroupIds. |
| ResourceGroupId | String | No | No | The ID of the resource group to which the instance, block storage, and ENIs belong. | None |
| SpotDuration | Integer | No | No | The retention period for the spot instance. | The value must be an integer from 0 to 6. Default value: 1. Unit: hours. Note To set the value to an integer from 2 to 6, submit a ticket. |
| ImageOwnerAlias | String | No | No | The source of the image. | Valid values:
|
| Period | Integer | No | No | The subscription duration of the resource. | This parameter is required and valid only when InstanceChargeType is set to PrePaid. Valid values: 1 to 9, 12, 24, 36, 48, and 60. Unit: months. |
| Ipv6AddressCount | Integer | No | No | The number of randomly generated IPv6 addresses to assign to the primary ENI. | The value must be an integer from 1 to 10. |
| PrivateIpAddress | String | No | No | The private IP address of the instance. | When you set the private IP address for an ECS instance in a VPC, you must select an idle CIDR block from the vSwitch. |
| PasswordInherit | Boolean | No | No | Specifies whether to use the preset password of the image. | Valid values:
Note You must specify either PasswordInherit or Password. |
| SystemDiskDeleteWithInstance | Boolean | No | No | Specifies whether to release the system disk when the instance is released. | Valid values:
|
| DeploymentSetId | String | No | No | The ID of the deployment set. | None |
| InstanceChargeType | String | No | No | The billing method of the instance. | Valid values:
|
| SystemDiskPerformanceLevel | String | No | No | The performance level of the ESSD that you use as the system disk. | Valid values:
|
DiskMappings syntax
"DiskMappings": [
{
"Category": String,
"DiskName": String,
"Description": String,
"SnapshotId": String,
"Size": String,
"Encrypted": String,
"DeleteWithInstance": String,
"PerformanceLevel": String
}
]DiskMappings properties
| Property | Type | Required | Update allowed | Description | Constraints |
| Category | String | No | No | The category of the data disk. | Valid values:
|
| DiskName | String | No | No | The name of the data 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 letters, Chinese characters, digits, colons (:), underscores (_), 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://. |
| SnapshotId | String | No | No | The snapshot used to create the data disk. | None |
| Size | String | No | No | System disk size | Valid values:
Unit: GB. |
| Encrypted | Boolean | No | No | Specifies whether to encrypt the data disk. | Valid values:
|
| DeleteWithInstance | Boolean | No | No | Specifies whether to release the data disk when the instance is released. | Valid values:
|
| PerformanceLevel | String | No | No | The performance level of the ESSD that you use as the data disk. | Valid values:
|
NetworkInterfaces syntax
"NetworkInterfaces": [
{
"PrimaryIpAddress": String,
"VSwitchId": String,
"SecurityGroupId": String,
"NetworkInterfaceName": String,
"Description": String
}
]NetworkInterfaces properties
| Property Name | Type | Required | Update allowed | Description | Constraints |
| PrimaryIpAddress | String | No | No | The primary private IP address of the ENI. | None |
| VSwitchId | String | No | No | The ID of the vSwitch to which the ENI belongs. | None |
| SecurityGroupId | String | No | No | The ID of the security group to which the ENI belongs. | None |
| NetworkInterfaceName | String | No | No | The name of the ENI. | None |
| Description | String | No | No | The description of the ENI. | The description must be 2 to 256 characters in length. It cannot start with http:// or https://. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]Tags properties
| Property | Type | Required | Update allowed | Description | Constraints |
| Key | String | No | No | The key of the tag. | 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 value of the tag. | The value can be up to 128 characters in length. It cannot start with aliyun or acs:. It cannot contain http:// or https://. |
TemplateTags syntax
"TemplateTags": [
{
"Value": String,
"Key": String
}
]TemplateTags properties
| Property | Type | Required | Update allowed | Description | Constraints |
| Key | String | No | No | The key of the tag. | The value must be 1 to 128 characters long, must not start with aliyun or acs:, and must not contain http:// or https://. |
| Value | String | No | No | The value of the tag. | The value can be up to 128 characters in length. It cannot start with aliyun or acs:. It cannot contain http:// or https://. |
Return values
Fn::GetAtt
- LaunchTemplateId: The ID of the launch template.
- LaunchTemplateName: The name of the launch template.
- DefaultVersionNumber: The default version number of the launch template.
- LatestVersionNumber: The latest version number of the launch template.
Examples
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Description": "Test ECS LaunchTemplate", "Parameters": { "VSwitchId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId" }, "SecurityGroupId": { "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId", "Type": "String" } }, "Resources": { "LaunchTemplate": { "Type": "ALIYUN::ECS::LaunchTemplate", "Properties": { "LaunchTemplateName": "mytest", "VersionDescription": "Test create LaunchTemplate", "ImageId": "centos_7", "InstanceType": "ecs.c5.large", "SystemDiskCategory": "cloud_essd", "SecurityGroupId": { "Ref": "SecurityGroupId" }, "VSwitchId": { "Ref": "VSwitchId" } } } }, "Outputs": { } }
For more examples that use an ECS launch template with an auto provisioning group, see the JSON example and YAML example.