ALIYUN::ECS::Instance类型用于创建ECS实例。
语法
{
"Type": "ALIYUN::ECS::Instance",
"Properties": {
"DedicatedHostId": String,
"Period": Number,
"AutoRenew": String,
"RamRoleName": String,
"IoOptimized": String,
"InternetChargeType": String,
"PrivateIpAddress": String,
"KeyPairName": String,
"SystemDiskDiskName": String,
"PeriodUnit": String,
"Description": String,
"Tags": List,
"HostName": String,
"AutoRenewPeriod": Number,
"ImageId": String,
"ResourceGroupId": String,
"InstanceChargeType": String,
"VSwitchId": String,
"Password": String,
"PasswordInherit": Boolean,
"InstanceType": String,
"SystemDiskCategory": String,
"UserData": String,
"SystemDiskSize": Number,
"ZoneId": String,
"InternetMaxBandwidthOut": Integer,
"VpcId": String,
"SpotStrategy": String,
"InstanceName": String,
"DeletionProtection": Boolean,
"DeploymentSetId": String,
"SecurityGroupId": String,
"SecurityEnhancementStrategy": String,
"SpotPriceLimit": String,
"HpcClusterId": String,
"AllocatePublicIP": Boolean,
"SystemDiskDescription": String,
"SystemDiskPerformanceLevel": String,
"DiskMappings": List,
"SpotInterruptionBehavior": String,
"ZoneIds": List,
"SpotDuration": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
ResourceGroupId | String | 否 | 是 | 资源组ID。 | 无 |
SpotInterruptionBehavior | String | 否 | 否 | 抢占实例中断模式。 | 目前仅支持Terminate(默认)直接释放实例。 |
ZoneIds | List | 否 | 否 | 可用区列表。 | 仅在控制台选取参数时生效。 |
SpotDuration | Integer | 否 | 否 | 抢占式实例的保留时长。 | 取值范围:0~6。
单位:小时。
|
SecurityGroupIds | List | 否 | 否 | 安全组ID列表。 | SecurityGroupId和SecurityGroupIds仅能指定其中一个。 |
ImageId | String | 是 | 是 | 镜像ID。包括公共镜像、自定义镜像和云市场镜像。 | 支持通过模糊的方式指定公共镜像ID,无需指定一个完整的公共镜像ID。例如:
|
InstanceType | String | 是 | 否 | ECS实例规格。 | 关于ECS实例规格的更多信息,请参见实例规格族。 |
SecurityGroupId | String | 否 | 否 | 安全组ID。 | SecurityGroupId和SecurityGroupIds仅能指定其中一个。 |
SecurityEnhancementStrategy | String | 否 | 否 | 是否开启安全加固。 | 取值:
|
Description | String | 否 | 是 | 描述信息。 | 长度为2~256个字符。 |
InstanceName | String | 否 | 否 | 实例名称。 | 长度为2~128个字符。必须以英文字母或汉字开头,不能以http:// 或https:// 开头。可包含数字、半角冒号(:)、下划线(_)或短划线(-)。
如果没有指定该属性,默认值为实例的InstanceId。 |
Password | String | 否 | 是 | ECS实例登录密码。 | 长度为8~30个字符。必须同时包含大写英文字母、小写英文字母、数字和特殊字符中至少三种,支持特殊字符:( ) ‘ ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ‘ < > , . ? / - 。如果指定该属性,请使用HTTPS协议调用API,以避免密码泄露。
|
PasswordInherit | Boolean | 否 | 否 | 是否使用镜像预设的密码。 | 取值:
说明 使用该属性时,Password必须为空,同时您需要确保使用的镜像已经设置了密码。
|
HostName | String | 否 | 否 | 云服务器的主机名。 | 最小长度为2个字符。半角句号(.)和短划线(-)不能作为主机名的首尾字符,且不能连续使用。
|
AllocatePublicIP | Boolean | 否 | 否 | 是否分配公网IP。 | 取值:
说明 如果InternetMaxBandwidthOut取值大于0,则会分配公网IP。
|
PrivateIpAddress | String | 否 | 否 | 在专有网络环境下,指定的内网IP。 | IP地址不能与专有网络下的其它实例重复。 |
InternetChargeType | String | 否 | 否 | 访问公网计费方式。 | 取值:
|
InternetMaxBandwidthOut | Integer | 否 | 否 | 公网出带宽最大值。 | 取值范围:0~100。
默认值:0。 单位:Mbps。 |
IoOptimized | String | 否 | 否 | 是否创建I/O优化实例。 | 取值:
|
DiskMappings | List | 否 | 否 | 需要挂载的数据盘。 | 最多支持16块数据盘。
更多信息,请参见DiskMappings语法和DiskMappings属性。 |
SystemDiskCategory | String | 否 | 否 | 系统盘类型。 | 取值:
|
SystemDiskDescription | String | 否 | 否 | 系统盘描述信息。 | 无 |
SystemDiskDiskName | String | 否 | 否 | 系统盘名称。 | 长度为2~128个字符。必须以英文字母或汉字开头,不能以http:// 或https:// 开头。可包含数字、半角冒号(:)、下划线(_)和短划线(-)。
|
SystemDiskSize | Number | 否 | 是 | 系统盘大小。 | 取值范围:20~500。
单位:GB。 如果使用自定义镜像创建系统盘,需要保证系统盘大于自定义镜像大小。 |
Tags | List | 否 | 是 | 用户自定义标签。 | 最多支持20个标签,格式:[{"Key": "tagKey", "Value": "tagValue"},{"Key": "tagKey2", "Value": "tagValue2"}] 。
|
UserData | String | 否 | 是 | 创建ECS实例时传递的用户数据。 | 内容需要限制在16 KB以内,不需要使用Base64转码,特殊字符需要使用反斜线(\)转义。 |
ZoneId | String | 否 | 否 | 可用区ID。 | 无 |
HpcClusterId | String | 否 | 否 | 实例所属的HPC集群ID。 | 无 |
VpcId | String | 否 | 否 | 专有网络ID。 | 无 |
VSwitchId | String | 否 | 否 | 交换机ID。 | 无 |
InstanceChargeType | String | 否 | 否 | ECS实例付费类型。 | 取值:
|
Period | Number | 否 | 否 | 付费周期。 | 当InstanceChargeType取值为PrePaid时,Period为必选属性;当InstanceChargeType取值为PostPaid时,Period为可选属性。 |
KeyPairName | String | 否 | 是 | ECS实例绑定的密钥对名称。 | 当实例类型为Windows时,请忽略该属性;当实例类型为Linux时,密码登录方式会被初始化为禁止。为提高实例安全性,建议您使用密钥对的连接方式。 |
RamRoleName | String | 否 | 否 | 实例RAM角色名称。 | 更多信息,请参见CreateRole和ListRoles。 |
SpotPriceLimit | String | 否 | 否 | 实例的每小时最高价格。 | 支持最多3位小数。当SpotStrategy取值为SpotWithPriceLimit时,该属性生效。 |
SpotStrategy | String | 否 | 否 | 按量付费实例的竞价策略。 | 当InstanceChargeType取值为PostPaid时,SpotStrategy为必选属性。
取值:
|
DedicatedHostId | String | 否 | 否 | ECS实例创建指定专有宿主机上。 | 您可以通过调用DescribeDedicatedHosts接口查询专有宿主机ID列表
。由于专有宿主机不支持创建抢占式实例,指定DedicatedHostId后,请求中的SpotStrategy和SpotPriceLimit设置将被自动忽略。 |
PeriodUnit | String | 否 | 否 | 购买资源的时长。 | 取值:
|
AutoRenewPeriod | Number | 否 | 否 | 每次自动续费的时长。 | 当AutoRenew取值为True时,AutoRenewPeriod为必选属性。
取值:
|
AutoRenew | String | 否 | 否 | 是否自动续费。 | 取值:
|
DeletionProtection | Boolean | 否 | 否 | 实例释放保护属性,指定是否支持通过控制台或DeleteInstance接口释放实例。 | 取值:
说明 该属性仅适用于按量付费实例,且只能限制手动释放操作,对系统释放操作不生效。
|
DeploymentSetId | String | 否 | 否 | 部署集ID。 | 无 |
SystemDiskPerformanceLevel | String | 否 | 否 | 创建ESSD云盘作为系统盘使用时,设置云盘的性能等级。 | 取值:
|
DiskMappings语法
"DiskMappings": [
{
"Category": String,
"DiskName": String,
"Description": String,
"Device": String,
"SnapshotId": String,
"PerformanceLevel": String,
"Size": String
}
]
DiskMappings属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Size | String | 是 | 否 | 数据盘大小。 | 取值范围:20~500。
单位:GB。 |
Category | String | 否 | 否 | 数据盘类型。 | 取值:
如果自定义镜像已包含了一个数据盘,那么创建ECS实例时,若要在ROS模板中指定数据盘类型,可以将Category指定为需要的数据盘类型。例如:
|
DiskName | String | 否 | 否 | 数据盘名称。 | 长度为2~128个字符。必须以英文字母或汉字开头,不能以http:// 或https:// 开头。可包含英文字母、汉字、数字、下划线(_)、半角冒号(:)和短划线(-)。
|
Description | String | 否 | 否 | 描述信息。 | 长度为2~256个字符,不能以http:// 或https:// 开头。
|
Device | String | 否 | 否 | 挂载点。 | 无 |
PerformanceLevel | String | 否 | 否 | 创建ESSD云盘作为数据盘使用时,设置云盘的性能等级。 | 取值:
|
SnapshotId | String | 否 | 否 | 数据盘使用的快照ID。 | 无 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Key | String | 是 | 否 | 标签键。 | 长度为1~128个字符,不能以aliyun 和acs: 开头,不能包含http:// 或https:// 。
|
Value | String | 否 | 否 | 标签值。 | 长度为0~128个字符,不能以aliyun 和acs: 开头,不能包含http:// 或https:// 。
|
返回值
Fn::GetAtt
- InstanceId:实例ID。由系统生成,实例的全局唯一标识。
- PrivateIp:VPC类型实例的私网IP地址。
- InnerIp:Classic类型实例的内网IP地址。
- PublicIp:Classic类型实例的公网IP地址。
- ZoneId:可用区ID。
- HostName:云服务器的主机名。
- PrimaryNetworkInterfaceId:主网卡ID。
- SecurityGroupIds:已创建实例的安全组ID列表。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"DedicatedHostId": {
"Type": "String",
"Description": "which dedicated host will be deployed"
},
"PrivateIpAddress": {
"Type": "String",
"Description": "Private IP for the instance created. Only works for VPC instance and cannot duplicated with existing instance."
},
"Description": {
"Type": "String",
"Description": "Description of the instance, [2, 256] characters. Do not fill or empty, the default is empty."
},
"ResourceGroupId": {
"Type": "String",
"Description": "Resource group id."
},
"DiskMappings": {
"Type": "Json",
"Description": "Disk mappings to attach to instance. Max support 16 disks.\nIf the image contains a data disk, you can specify other parameters of the data disk via the same value of parameter \"Device\". If parameter \"Category\" is not specified, it will be cloud_efficiency instead of \"Category\" of data disk in the image.",
"MaxLength": 16
},
"UserData": {
"Type": "String",
"Description": "User data to pass to instance. [1, 16KB] characters.User data should not be base64 encoded. If you want to pass base64 encoded string to the property, use function Fn::Base64Decode to decode the base64 string first."
},
"SystemDiskSize": {
"Type": "Number",
"Description": "Disk size of the system disk, range from 20 to 500 GB. If you specify with your own image, make sure the system disk size bigger than image size. ",
"MinValue": 20
},
"SystemDiskDescription": {
"Type": "String",
"Description": "Description of created system disk."
},
"InstanceChargeType": {
"Type": "String",
"Description": "Instance Charge type, allowed value: Prepaid and Postpaid. If specified Prepaid, please ensure you have sufficient balance in your account. Or instance creation will be failure. Default value is Postpaid.",
"AllowedValues": [
"Subscription",
"PrePaid",
"PrePay",
"Prepaid",
"PayAsYouGo",
"PostPaid",
"PayOnDemand",
"Postpaid"
],
"Default": "PostPaid"
},
"AutoRenew": {
"Type": "String",
"Description": "Whether renew the fee automatically? When the parameter InstanceChargeType is PrePaid, it will take effect. Range of value:True: automatic renewal.False: no automatic renewal. Default value is False.",
"AllowedValues": [
"True",
"False"
],
"Default": "False"
},
"RamRoleName": {
"Type": "String",
"Description": "Instance RAM role name. The name is provided and maintained by Resource Access Management (RAM) and can be queried using ListRoles. For more information, see RAM API CreateRole and ListRoles."
},
"SystemDiskPerformanceLevel": {
"Type": "String",
"Description": "The performance level of the enhanced SSD used as the system disk.Default value: PL1. Valid values:PL0: A single enhanced SSD delivers up to 10,000 random read/write IOPS.PL1: A single enhanced SSD delivers up to 50,000 random read/write IOPS.PL2: A single enhanced SSD delivers up to 100,000 random read/write IOPS.PL3: A single enhanced SSD delivers up to 1,000,000 random read/write IOPS."
},
"ImageId": {
"Type": "String",
"Description": "Image ID to create ecs instance."
},
"SystemDiskDiskName": {
"Type": "String",
"Description": "Name of created system disk."
},
"SpotPriceLimit": {
"Type": "String",
"Description": "The hourly price threshold of a instance, and it takes effect only when parameter InstanceChargeType is PostPaid. Three decimals is allowed at most. "
},
"InstanceType": {
"Type": "String",
"Description": "Ecs instance supported instance type, make sure it should be correct."
},
"AllocatePublicIP": {
"Type": "Boolean",
"Description": "The public ip for ecs instance, if properties is true, will allocate public ip. If property InternetMaxBandwidthOut set to 0, it will not assign public ip.",
"AllowedValues": [
"True",
"true",
"False",
"false"
],
"Default": true
},
"Tags": {
"Type": "Json",
"Description": "Tags to attach to instance. Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.",
"MaxLength": 20
},
"HostName": {
"Type": "String",
"Description": "Host name of created ecs instance. at least 2 characters, and '.' '-' Is not the first and last characters as hostname, not continuous use. Windows platform can be up to 15 characters, allowing letters (without limiting case), numbers and '-', and does not support the number of points, not all is digital ('.').Other (Linux, etc.) platform up to 30 characters, allowing support number multiple points for the period between the points, each permit letters (without limiting case), numbers and '-' components."
},
"SpotStrategy": {
"Type": "String",
"Description": "The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter InstanceChargeType is PostPaid. Value range: \"NoSpot: A regular Pay-As-You-Go instance\", \"SpotWithPriceLimit: A price threshold for a spot instance, \"\"SpotAsPriceGo: A price that is based on the highest Pay-As-You-Go instance. \"Default value: NoSpot.",
"AllowedValues": [
"NoSpot",
"SpotWithPriceLimit",
"SpotAsPriceGo"
]
},
"PasswordInherit": {
"Type": "Boolean",
"Description": "Specifies whether to use the password preset in the image. To use the PasswordInherit parameter, the Password parameter must be empty and you must make sure that the selected image has a password configured.",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"Password": {
"Type": "String",
"Description": "Password of created ecs instance. Must contain at least 3 types of special character, lower character, upper character, number."
},
"AutoRenewPeriod": {
"Type": "Number",
"Description": "The time period of auto renew. When the parameter InstanceChargeType is PrePaid, it will take effect. It could be 1, 2, 3, 6, 12. Default value is 1.",
"AllowedValues": [
1,
2,
3,
6,
12
],
"Default": 1
},
"KeyPairName": {
"Type": "String",
"Description": "SSH key pair name."
},
"IoOptimized": {
"Type": "String",
"Description": "The 'optimized' instance can provide better IO performance. Support 'none' and 'optimized' only, default is 'optimized'.",
"AllowedValues": [
"none",
"optimized"
],
"Default": "optimized"
},
"ZoneId": {
"Type": "String",
"Description": "The ID of the zone to which the instance belongs. For more information, \ncall the DescribeZones operation to query the most recent zone list. \nDefault value is empty, which means random selection."
},
"HpcClusterId": {
"Type": "String",
"Description": "The HPC cluster ID to which the instance belongs."
},
"VSwitchId": {
"Type": "String",
"Description": "The vSwitch Id to create ecs instance."
},
"SecurityGroupId": {
"Type": "String",
"Description": "Security group to create ecs instance. For classic instance need the security group not belong to VPC, for VPC instance, please make sure the security group belong to specified VPC."
},
"Period": {
"Type": "Number",
"Description": "Prepaid time period. Unit is month, it could be from 1 to 9 or 12, 24, 36, 48, 60. Default value is 1.",
"AllowedValues": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
12,
24,
36,
48,
60
],
"Default": 1
},
"DeletionProtection": {
"Type": "Boolean",
"Description": "Whether an instance can be released manually through the console or API, deletion protection only support postPaid instance",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"SecurityGroupIds": {
"Type": "Json",
"Description": "The ID list of security group to which to assign the instance. The max length is based on the maximum number of security groups to which an instance can belong. For more information, see the \"Security group limits\" section in Limits.",
"MinLength": 1,
"MaxLength": 16
},
"InternetChargeType": {
"Type": "String",
"Description": "Instance internet access charge type.Support 'PayByBandwidth' and 'PayByTraffic' only. Default is PayByTraffic",
"AllowedValues": [
"paybytraffic",
"PayByTraffic",
"paybybandwidth",
"PayByBandwidth"
],
"Default": "PayByTraffic"
},
"SystemDiskCategory": {
"Type": "String",
"Description": "Category of system disk. Default is cloud_efficiency. support cloud|cloud_efficiency|cloud_ssd|cloud_essd|ephemeral_ssd",
"AllowedValues": [
"cloud",
"cloud_efficiency",
"cloud_ssd",
"cloud_essd",
"ephemeral_ssd"
],
"Default": "cloud_efficiency"
},
"InstanceName": {
"Type": "String",
"Description": "Display name of the instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'"
},
"DeploymentSetId": {
"Type": "String",
"Description": "Deployment set ID."
},
"InternetMaxBandwidthOut": {
"Type": "Number",
"Description": "Set internet output bandwidth of instance. Unit is Mbps(Mega bit per second). Range is [0,200]. Default is 1.While the property is not 0, public ip will be assigned for instance.",
"MinValue": 0,
"MaxValue": 200,
"Default": 1
},
"VpcId": {
"Type": "String",
"Description": "The VPC id to create ecs instance."
},
"SecurityEnhancementStrategy": {
"Type": "String",
"Description": "",
"AllowedValues": [
"Active",
"Deactive"
]
},
"PeriodUnit": {
"Type": "String",
"Description": "Unit of prepaid time period, it could be Week/Month/Year. Default value is Month.",
"AllowedValues": [
"Week",
"Month",
"Year"
],
"Default": "Month"
}
},
"Resources": {
"Instance": {
"Type": "ALIYUN::ECS::Instance",
"Properties": {
"DedicatedHostId": {
"Ref": "DedicatedHostId"
},
"PrivateIpAddress": {
"Ref": "PrivateIpAddress"
},
"Description": {
"Ref": "Description"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"DiskMappings": {
"Ref": "DiskMappings"
},
"UserData": {
"Ref": "UserData"
},
"SystemDiskSize": {
"Ref": "SystemDiskSize"
},
"SystemDiskDescription": {
"Ref": "SystemDiskDescription"
},
"InstanceChargeType": {
"Ref": "InstanceChargeType"
},
"AutoRenew": {
"Ref": "AutoRenew"
},
"RamRoleName": {
"Ref": "RamRoleName"
},
"SystemDiskPerformanceLevel": {
"Ref": "SystemDiskPerformanceLevel"
},
"ImageId": {
"Ref": "ImageId"
},
"SystemDiskDiskName": {
"Ref": "SystemDiskDiskName"
},
"SpotPriceLimit": {
"Ref": "SpotPriceLimit"
},
"InstanceType": {
"Ref": "InstanceType"
},
"AllocatePublicIP": {
"Ref": "AllocatePublicIP"
},
"Tags": {
"Ref": "Tags"
},
"HostName": {
"Ref": "HostName"
},
"SpotStrategy": {
"Ref": "SpotStrategy"
},
"PasswordInherit": {
"Ref": "PasswordInherit"
},
"Password": {
"Ref": "Password"
},
"AutoRenewPeriod": {
"Ref": "AutoRenewPeriod"
},
"KeyPairName": {
"Ref": "KeyPairName"
},
"IoOptimized": {
"Ref": "IoOptimized"
},
"ZoneId": {
"Ref": "ZoneId"
},
"HpcClusterId": {
"Ref": "HpcClusterId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"SecurityGroupId": {
"Ref": "SecurityGroupId"
},
"Period": {
"Ref": "Period"
},
"DeletionProtection": {
"Ref": "DeletionProtection"
},
"SecurityGroupIds": {
"Ref": "SecurityGroupIds"
},
"InternetChargeType": {
"Ref": "InternetChargeType"
},
"SystemDiskCategory": {
"Ref": "SystemDiskCategory"
},
"InstanceName": {
"Ref": "InstanceName"
},
"DeploymentSetId": {
"Ref": "DeploymentSetId"
},
"InternetMaxBandwidthOut": {
"Ref": "InternetMaxBandwidthOut"
},
"VpcId": {
"Ref": "VpcId"
},
"SecurityEnhancementStrategy": {
"Ref": "SecurityEnhancementStrategy"
},
"PeriodUnit": {
"Ref": "PeriodUnit"
}
}
}
},
"Outputs": {
"PrimaryNetworkInterfaceId": {
"Description": "Primary network interface ID of created instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"PrimaryNetworkInterfaceId"
]
}
},
"InnerIp": {
"Description": "Inner IP address of the specified instance. Only for classical instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"InnerIp"
]
}
},
"ZoneId": {
"Description": "Zone ID of created instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"ZoneId"
]
}
},
"PrivateIp": {
"Description": "Private IP address of created ecs instance. Only for VPC instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"PrivateIp"
]
}
},
"InstanceId": {
"Description": "The instance ID of created ecs instance",
"Value": {
"Fn::GetAtt": [
"Instance",
"InstanceId"
]
}
},
"PublicIp": {
"Description": "Public IP address of created ecs instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"PublicIp"
]
}
},
"SecurityGroupIds": {
"Description": "Security group ID list of created instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"SecurityGroupIds"
]
}
},
"HostName": {
"Description": "Host name of created instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"HostName"
]
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
AllocatePublicIP:
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Default: true
Description: The public ip for ecs instance, if properties is true, will allocate
public ip. If property InternetMaxBandwidthOut set to 0, it will not assign
public ip.
Type: Boolean
AutoRenew:
AllowedValues:
- 'True'
- 'False'
Default: 'False'
Description: 'Whether renew the fee automatically? When the parameter InstanceChargeType
is PrePaid, it will take effect. Range of value:True: automatic renewal.False:
no automatic renewal. Default value is False.'
Type: String
AutoRenewPeriod:
AllowedValues:
- 1
- 2
- 3
- 6
- 12
Default: 1
Description: The time period of auto renew. When the parameter InstanceChargeType
is PrePaid, it will take effect. It could be 1, 2, 3, 6, 12. Default value is
1.
Type: Number
DedicatedHostId:
Description: which dedicated host will be deployed
Type: String
DeletionProtection:
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Description: Whether an instance can be released manually through the console
or API, deletion protection only support postPaid instance
Type: Boolean
DeploymentSetId:
Description: Deployment set ID.
Type: String
Description:
Description: Description of the instance, [2, 256] characters. Do not fill or
empty, the default is empty.
Type: String
DiskMappings:
Description: 'Disk mappings to attach to instance. Max support 16 disks.
If the image contains a data disk, you can specify other parameters of the data
disk via the same value of parameter "Device". If parameter "Category" is not
specified, it will be cloud_efficiency instead of "Category" of data disk in
the image.'
MaxLength: 16
Type: Json
HostName:
Description: Host name of created ecs instance. at least 2 characters, and '.'
'-' Is not the first and last characters as hostname, not continuous use. Windows
platform can be up to 15 characters, allowing letters (without limiting case),
numbers and '-', and does not support the number of points, not all is digital
('.').Other (Linux, etc.) platform up to 30 characters, allowing support number
multiple points for the period between the points, each permit letters (without
limiting case), numbers and '-' components.
Type: String
HpcClusterId:
Description: The HPC cluster ID to which the instance belongs.
Type: String
ImageId:
Description: Image ID to create ecs instance.
Type: String
InstanceChargeType:
AllowedValues:
- Subscription
- PrePaid
- PrePay
- Prepaid
- PayAsYouGo
- PostPaid
- PayOnDemand
- Postpaid
Default: PostPaid
Description: 'Instance Charge type, allowed value: Prepaid and Postpaid. If specified
Prepaid, please ensure you have sufficient balance in your account. Or instance
creation will be failure. Default value is Postpaid.'
Type: String
InstanceName:
Description: Display name of the instance, [2, 128] English or Chinese characters,
must start with a letter or Chinese in size, can contain numbers, '_' or '.',
'-'
Type: String
InstanceType:
Description: Ecs instance supported instance type, make sure it should be correct.
Type: String
InternetChargeType:
AllowedValues:
- paybytraffic
- PayByTraffic
- paybybandwidth
- PayByBandwidth
Default: PayByTraffic
Description: Instance internet access charge type.Support 'PayByBandwidth' and
'PayByTraffic' only. Default is PayByTraffic
Type: String
InternetMaxBandwidthOut:
Default: 1
Description: Set internet output bandwidth of instance. Unit is Mbps(Mega bit
per second). Range is [0,200]. Default is 1.While the property is not 0, public
ip will be assigned for instance.
MaxValue: 200
MinValue: 0
Type: Number
IoOptimized:
AllowedValues:
- none
- optimized
Default: optimized
Description: The 'optimized' instance can provide better IO performance. Support
'none' and 'optimized' only, default is 'optimized'.
Type: String
KeyPairName:
Description: SSH key pair name.
Type: String
Password:
Description: Password of created ecs instance. Must contain at least 3 types of
special character, lower character, upper character, number.
Type: String
PasswordInherit:
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Description: Specifies whether to use the password preset in the image. To use
the PasswordInherit parameter, the Password parameter must be empty and you
must make sure that the selected image has a password configured.
Type: Boolean
Period:
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
- 48
- 60
Default: 1
Description: Prepaid time period. Unit is month, it could be from 1 to 9 or 12,
24, 36, 48, 60. Default value is 1.
Type: Number
PeriodUnit:
AllowedValues:
- Week
- Month
- Year
Default: Month
Description: Unit of prepaid time period, it could be Week/Month/Year. Default
value is Month.
Type: String
PrivateIpAddress:
Description: Private IP for the instance created. Only works for VPC instance
and cannot duplicated with existing instance.
Type: String
RamRoleName:
Description: Instance RAM role name. The name is provided and maintained by Resource
Access Management (RAM) and can be queried using ListRoles. For more information,
see RAM API CreateRole and ListRoles.
Type: String
ResourceGroupId:
Description: Resource group id.
Type: String
SecurityEnhancementStrategy:
AllowedValues:
- Active
- Deactive
Description: ''
Type: String
SecurityGroupId:
Description: Security group to create ecs instance. For classic instance need
the security group not belong to VPC, for VPC instance, please make sure the
security group belong to specified VPC.
Type: String
SecurityGroupIds:
Description: The ID list of security group to which to assign the instance. The
max length is based on the maximum number of security groups to which an instance
can belong. For more information, see the "Security group limits" section in
Limits.
MaxLength: 16
MinLength: 1
Type: Json
SpotPriceLimit:
Description: 'The hourly price threshold of a instance, and it takes effect only
when parameter InstanceChargeType is PostPaid. Three decimals is allowed at
most. '
Type: String
SpotStrategy:
AllowedValues:
- NoSpot
- SpotWithPriceLimit
- SpotAsPriceGo
Description: 'The spot strategy of a Pay-As-You-Go instance, and it takes effect
only when parameter InstanceChargeType is PostPaid. Value range: "NoSpot: A
regular Pay-As-You-Go instance", "SpotWithPriceLimit: A price threshold for
a spot instance, ""SpotAsPriceGo: A price that is based on the highest Pay-As-You-Go
instance. "Default value: NoSpot.'
Type: String
SystemDiskCategory:
AllowedValues:
- cloud
- cloud_efficiency
- cloud_ssd
- cloud_essd
- ephemeral_ssd
Default: cloud_efficiency
Description: Category of system disk. Default is cloud_efficiency. support cloud|cloud_efficiency|cloud_ssd|cloud_essd|ephemeral_ssd
Type: String
SystemDiskDescription:
Description: Description of created system disk.
Type: String
SystemDiskDiskName:
Description: Name of created system disk.
Type: String
SystemDiskPerformanceLevel:
Description: 'The performance level of the enhanced SSD used as the system disk.Default
value: PL1. Valid values:PL0: A single enhanced SSD delivers up to 10,000 random
read/write IOPS.PL1: A single enhanced SSD delivers up to 50,000 random read/write
IOPS.PL2: A single enhanced SSD delivers up to 100,000 random read/write IOPS.PL3:
A single enhanced SSD delivers up to 1,000,000 random read/write IOPS.'
Type: String
SystemDiskSize:
Description: 'Disk size of the system disk, range from 20 to 500 GB. If you specify
with your own image, make sure the system disk size bigger than image size. '
MinValue: 20
Type: Number
Tags:
Description: Tags to attach to instance. Max support 20 tags to add during create
instance. Each tag with two properties Key and Value, and Key is required.
MaxLength: 20
Type: Json
UserData:
Description: User data to pass to instance. [1, 16KB] characters.User data should
not be base64 encoded. If you want to pass base64 encoded string to the property,
use function Fn::Base64Decode to decode the base64 string first.
Type: String
VSwitchId:
Description: The vSwitch Id to create ecs instance.
Type: String
VpcId:
Description: The VPC id to create ecs instance.
Type: String
ZoneId:
Description: "The ID of the zone to which the instance belongs. For more information,\
\ \ncall the DescribeZones operation to query the most recent zone list. \n\
Default value is empty, which means random selection."
Type: String
Resources:
Instance:
Properties:
AllocatePublicIP:
Ref: AllocatePublicIP
AutoRenew:
Ref: AutoRenew
AutoRenewPeriod:
Ref: AutoRenewPeriod
DedicatedHostId:
Ref: DedicatedHostId
DeletionProtection:
Ref: DeletionProtection
DeploymentSetId:
Ref: DeploymentSetId
Description:
Ref: Description
DiskMappings:
Ref: DiskMappings
HostName:
Ref: HostName
HpcClusterId:
Ref: HpcClusterId
ImageId:
Ref: ImageId
InstanceChargeType:
Ref: InstanceChargeType
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
InternetChargeType:
Ref: InternetChargeType
InternetMaxBandwidthOut:
Ref: InternetMaxBandwidthOut
IoOptimized:
Ref: IoOptimized
KeyPairName:
Ref: KeyPairName
Password:
Ref: Password
PasswordInherit:
Ref: PasswordInherit
Period:
Ref: Period
PeriodUnit:
Ref: PeriodUnit
PrivateIpAddress:
Ref: PrivateIpAddress
RamRoleName:
Ref: RamRoleName
ResourceGroupId:
Ref: ResourceGroupId
SecurityEnhancementStrategy:
Ref: SecurityEnhancementStrategy
SecurityGroupId:
Ref: SecurityGroupId
SecurityGroupIds:
Ref: SecurityGroupIds
SpotPriceLimit:
Ref: SpotPriceLimit
SpotStrategy:
Ref: SpotStrategy
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskDescription:
Ref: SystemDiskDescription
SystemDiskDiskName:
Ref: SystemDiskDiskName
SystemDiskPerformanceLevel:
Ref: SystemDiskPerformanceLevel
SystemDiskSize:
Ref: SystemDiskSize
Tags:
Ref: Tags
UserData:
Ref: UserData
VSwitchId:
Ref: VSwitchId
VpcId:
Ref: VpcId
ZoneId:
Ref: ZoneId
Type: ALIYUN::ECS::Instance
Outputs:
HostName:
Description: Host name of created instance.
Value:
Fn::GetAtt:
- Instance
- HostName
InnerIp:
Description: Inner IP address of the specified instance. Only for classical instance.
Value:
Fn::GetAtt:
- Instance
- InnerIp
InstanceId:
Description: The instance ID of created ecs instance
Value:
Fn::GetAtt:
- Instance
- InstanceId
PrimaryNetworkInterfaceId:
Description: Primary network interface ID of created instance.
Value:
Fn::GetAtt:
- Instance
- PrimaryNetworkInterfaceId
PrivateIp:
Description: Private IP address of created ecs instance. Only for VPC instance.
Value:
Fn::GetAtt:
- Instance
- PrivateIp
PublicIp:
Description: Public IP address of created ecs instance.
Value:
Fn::GetAtt:
- Instance
- PublicIp
SecurityGroupIds:
Description: Security group ID list of created instance.
Value:
Fn::GetAtt:
- Instance
- SecurityGroupIds
ZoneId:
Description: Zone ID of created instance.
Value:
Fn::GetAtt:
- Instance
- ZoneId
更多示例,请参见创建单个ECS实例、创建SSH密钥对和绑定SSH密钥和ECS实例的组合示例:JSON示例和YAML示例。