ALIYUN::CDDC::MyBase类型用于创建专有版主机。
语法
{
"Type": "ALIYUN::CDDC::MyBase",
"Properties": {
"EcsInstanceName": String,
"PeriodType": String,
"ResourceGroupId": String,
"UserData": String,
"DedicatedHostGroupDescription": String,
"DedicatedHostGroupId": String,
"AutoRenew": Boolean,
"EcsUniqueSuffix": Boolean,
"ImageId": String,
"UserDataInBase64": Boolean,
"EcsHostName": String,
"Engine": String,
"PasswordInherit": Boolean,
"KeyPairName": String,
"ZoneId": String,
"VSwitchId": String,
"SecurityGroupId": String,
"ECSClassList": List,
"Period": Integer,
"PayType": String,
"InternetChargeType": String,
"EcsDeploymentSetId": String,
"InternetMaxBandwidthOut": Integer,
"VpcId": String,
"OsPassword": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ECSClassList | List | 是 | 否 | ECS规格信息。 | 示例值:
|
Engine | String | 是 | 否 | 数据库类型。 | 取值:
|
PayType | String | 是 | 否 | 付费类型。 | 目前仅支持PrePaid。 |
Period | Integer | 是 | 否 | 购买时长。 | 无 |
SecurityGroupId | String | 是 | 否 | 安全组ID。 | 无 |
VpcId | String | 是 | 否 | 专有网络VPC ID。 | 无 |
VSwitchId | String | 是 | 否 | 虚拟交换机ID。 | 无 |
ZoneId | String | 是 | 否 | 可用区ID。 | 无 |
AutoRenew | Boolean | 否 | 否 | 是否开启自动续费。 | 取值:
|
DedicatedHostGroupDescription | String | 否 | 否 | 专属集群的名称。 | 无 |
DedicatedHostGroupId | String | 否 | 否 | 已有专有版专属集群ID。 | 无 |
EcsDeploymentSetId | String | 否 | 否 | 云服务器部署集ID。 | 无 |
EcsHostName | String | 否 | 否 | 主机名。 |
|
EcsInstanceName | String | 否 | 否 | ECS实例名称。 | 长度为2~128个字符,必须以大小写字母或中文开头,不能以 默认值:InstanceId。 |
EcsUniqueSuffix | Boolean | 否 | 否 | 当创建多台实例时,是否为HostName和InstanceName自动添加有序后缀。 | 有序后缀从001开始递增,最大不能超过999。 取值:
当HostName或InstanceName按照指定排序格式设置,未设置命名后缀 |
ImageId | String | 否 | 否 | 自定义镜像ID。 | 若您需要使用默认镜像,无需填写。 |
InternetChargeType | String | 否 | 否 | 网络计费类型。 | 取值:
|
InternetMaxBandwidthOut | Integer | 否 | 否 | 公网出带宽最大值。 | 单位为Mbit/s。 取值范围:0~100。 默认值:0。设定为大于0时会自动创建公网IP。 |
KeyPairName | String | 否 | 否 | 密钥对名称。 | 无 |
OsPassword | String | 否 | 否 | 主机登录密码。 | 密码须符合如下要求:
说明 如果需要稍后设置主机登录密码,此参数填写空字符串即可。
|
PasswordInherit | Boolean | 否 | 否 | 是否使用镜像的默认密码。 | 取值:
说明 若使用镜像的默认密码,OSPassword参数无需填写。 |
PeriodType | String | 否 | 否 | 预付费类型。 | 目前仅支持Monthly(包月)。 |
ResourceGroupId | String | 否 | 否 | 资源组ID。 | 无 |
UserData | String | 否 | 否 | 用户自定义脚本数据。 | 原始数据最多为16KB。 |
UserDataInBase64 | Boolean | 否 | 否 | 自定义数据是否采用Base64格式编码。 | 取值:
|
返回值
Fn::GetAtt
OrderIds:订单ID列表。
InstanceIds:已创建成功的ECS主机ID。
示例
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
AutoRenew:
Description:
en: Whether to enable auto renew.
Required: false
Type: Boolean
DedicatedHostGroupDescription:
Description:
en: The name of the dedicated cluster.
Required: false
Type: String
DedicatedHostGroupId:
Description:
en: The ID of the dedicated cluster.
Required: false
Type: String
ECSClassList:
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: ECS Class Properties.
Required: true
Type: Json
Description:
en: ECS Class List.
MaxLength: 1
MinLength: 1
Required: true
Type: Json
EcsDeploymentSetId:
Description:
en: The ID of the deployment set.
Required: false
Type: String
EcsHostName:
Description:
en: The host name of the ECS instance.
Required: false
Type: String
EcsInstanceName:
Description:
en: The name of the ECS instance.
Required: false
Type: String
EcsUniqueSuffix:
Description:
en: The unique suffix of the ECS instance.
Required: false
Type: Boolean
Engine:
Description:
en: Database type.
Required: true
Type: String
ImageId:
Description:
en: The image ID.
Required: false
Type: String
InternetChargeType:
AllowedValues:
- PayByTraffic
- PayByBandwidth
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Description:
en: "Network billing type. Value range: \nPayByBandwidth: billed based on fixed\
\ bandwidth. \nPayByTraffic: Pay by traffic usage."
Required: false
Type: String
InternetMaxBandwidthOut:
Description:
en: "Set internet output bandwidth of instance. Unit is Mbps(Mega bit per second).\
\ \nRange is [0,200]. Default is 1. \nWhile the property is not 0, public\
\ ip will be assigned for instance."
MinValue: 0
Required: false
Type: Number
KeyPairName:
Description:
en: The name of the key pair.
Required: false
Type: String
OsPassword:
Description:
en: Password of created ecs instance. Must contain at least 3 types of special
character, lower character, upper character, number.
Required: false
Type: String
PasswordInherit:
Description:
en: Whether to inherit the password from the parent cluster.
Required: false
Type: Boolean
PayType:
AllowedValues:
- Subscription
Description:
en: Payment type, currently only supports PrePaid.
Required: true
Type: String
Period:
AssociationProperty: PayPeriod
Description:
en: The period of the subscription in months.
MaxValue: 12
MinValue: 1
Required: true
Type: Number
PeriodType:
AssociationProperty: PayPeriodUnit
Description:
en: Prepaid type, currently only supports Monthly (monthly subscription).
Required: false
Type: String
ResourceGroupId:
Description:
en: Resource group id.
Required: false
Type: String
SecurityGroupId:
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VpcId}
Description:
en: The ID of the security group.
Required: true
Type: String
UserData:
AssociationProperty: TextArea
Description:
en: User-defined script data, the original data is up to 16KB.
Required: false
Type: String
UserDataInBase64:
Description:
en: The user data of the ECS instance.
Required: false
Type: Boolean
VSwitchId:
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
Description:
en: Virtual switch ID.
Required: true
Type: String
VpcId:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Description:
en: The ID of the VPC.
Required: true
Type: String
ZoneId:
AssociationProperty: ZoneId
Description:
en: Availability Zone ID.
Required: true
Type: String
Resources:
MyBase:
Properties:
AutoRenew:
Ref: AutoRenew
DedicatedHostGroupDescription:
Ref: DedicatedHostGroupDescription
DedicatedHostGroupId:
Ref: DedicatedHostGroupId
ECSClassList:
Ref: ECSClassList
EcsDeploymentSetId:
Ref: EcsDeploymentSetId
EcsHostName:
Ref: EcsHostName
EcsInstanceName:
Ref: EcsInstanceName
EcsUniqueSuffix:
Ref: EcsUniqueSuffix
Engine:
Ref: Engine
ImageId:
Ref: ImageId
InternetChargeType:
Ref: InternetChargeType
InternetMaxBandwidthOut:
Ref: InternetMaxBandwidthOut
KeyPairName:
Ref: KeyPairName
OsPassword:
Ref: OsPassword
PasswordInherit:
Ref: PasswordInherit
PayType:
Ref: PayType
Period:
Ref: Period
PeriodType:
Ref: PeriodType
ResourceGroupId:
Ref: ResourceGroupId
SecurityGroupId:
Ref: SecurityGroupId
UserData:
Ref: UserData
UserDataInBase64:
Ref: UserDataInBase64
VSwitchId:
Ref: VSwitchId
VpcId:
Ref: VpcId
ZoneId:
Ref: ZoneId
Type: ALIYUN::CDDC::MyBase
Outputs:
InstanceIds:
Description: The instance id list of created ecs instances
Value:
Fn::GetAtt:
- MyBase
- InstanceIds
OrderIds:
Description: The order id list.
Value:
Fn::GetAtt:
- MyBase
- OrderIds
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"EcsInstanceName": {
"Type": "String",
"Description": {
"en": "The name of the ECS instance."
},
"Required": false
},
"PeriodType": {
"AssociationProperty": "PayPeriodUnit",
"Type": "String",
"Description": {
"en": "Prepaid type, currently only supports Monthly (monthly subscription)."
},
"Required": false
},
"ResourceGroupId": {
"Type": "String",
"Description": {
"en": "Resource group id."
},
"Required": false
},
"UserData": {
"AssociationProperty": "TextArea",
"Type": "String",
"Description": {
"en": "User-defined script data, the original data is up to 16KB."
},
"Required": false
},
"DedicatedHostGroupDescription": {
"Type": "String",
"Description": {
"en": "The name of the dedicated cluster."
},
"Required": false
},
"DedicatedHostGroupId": {
"Type": "String",
"Description": {
"en": "The ID of the dedicated cluster."
},
"Required": false
},
"AutoRenew": {
"Type": "Boolean",
"Description": {
"en": "Whether to enable auto renew."
},
"Required": false
},
"EcsUniqueSuffix": {
"Type": "Boolean",
"Description": {
"en": "The unique suffix of the ECS instance."
},
"Required": false
},
"ImageId": {
"Type": "String",
"Description": {
"en": "The image ID."
},
"Required": false
},
"UserDataInBase64": {
"Type": "Boolean",
"Description": {
"en": "The user data of the ECS instance."
},
"Required": false
},
"EcsHostName": {
"Type": "String",
"Description": {
"en": "The host name of the ECS instance."
},
"Required": false
},
"Engine": {
"Type": "String",
"Description": {
"en": "Database type."
},
"Required": true
},
"PasswordInherit": {
"Type": "Boolean",
"Description": {
"en": "Whether to inherit the password from the parent cluster."
},
"Required": false
},
"KeyPairName": {
"Type": "String",
"Description": {
"en": "The name of the key pair."
},
"Required": false
},
"ZoneId": {
"AssociationProperty": "ZoneId",
"Type": "String",
"Description": {
"en": "Availability Zone ID."
},
"Required": true
},
"VSwitchId": {
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
},
"AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
"Type": "String",
"Description": {
"en": "Virtual switch ID."
},
"Required": true
},
"SecurityGroupId": {
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}"
},
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"Type": "String",
"Description": {
"en": "The ID of the security group."
},
"Required": true
},
"ECSClassList": {
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "Json",
"Description": {
"en": "ECS Class Properties."
},
"Required": true
}
},
"AssociationProperty": "List[Parameter]",
"Type": "Json",
"Description": {
"en": "ECS Class List."
},
"Required": true,
"MinLength": 1,
"MaxLength": 1
},
"Period": {
"AssociationProperty": "PayPeriod",
"Type": "Number",
"Description": {
"en": "The period of the subscription in months."
},
"Required": true,
"MinValue": 1,
"MaxValue": 12
},
"PayType": {
"Type": "String",
"Description": {
"en": "Payment type, currently only supports PrePaid."
},
"AllowedValues": [
"Subscription"
],
"Required": true
},
"InternetChargeType": {
"AssociationPropertyMetadata": {
"LocaleKey": "InternetChargeType"
},
"Type": "String",
"Description": {
"en": "Network billing type. Value range: \nPayByBandwidth: billed based on fixed bandwidth. \nPayByTraffic: Pay by traffic usage."
},
"AllowedValues": [
"PayByTraffic",
"PayByBandwidth"
],
"Required": false
},
"EcsDeploymentSetId": {
"Type": "String",
"Description": {
"en": "The ID of the deployment set."
},
"Required": false
},
"InternetMaxBandwidthOut": {
"Type": "Number",
"Description": {
"en": "Set internet output bandwidth of instance. Unit is Mbps(Mega bit per second). \nRange is [0,200]. Default is 1. \nWhile the property is not 0, public ip will be assigned for instance."
},
"Required": false,
"MinValue": 0
},
"VpcId": {
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
"Type": "String",
"Description": {
"en": "The ID of the VPC."
},
"Required": true
},
"OsPassword": {
"Type": "String",
"Description": {
"en": "Password of created ecs instance. Must contain at least 3 types of special character, lower character, upper character, number."
},
"Required": false
}
},
"Resources": {
"MyBase": {
"Type": "ALIYUN::CDDC::MyBase",
"Properties": {
"EcsInstanceName": {
"Ref": "EcsInstanceName"
},
"PeriodType": {
"Ref": "PeriodType"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"UserData": {
"Ref": "UserData"
},
"DedicatedHostGroupDescription": {
"Ref": "DedicatedHostGroupDescription"
},
"DedicatedHostGroupId": {
"Ref": "DedicatedHostGroupId"
},
"AutoRenew": {
"Ref": "AutoRenew"
},
"EcsUniqueSuffix": {
"Ref": "EcsUniqueSuffix"
},
"ImageId": {
"Ref": "ImageId"
},
"UserDataInBase64": {
"Ref": "UserDataInBase64"
},
"EcsHostName": {
"Ref": "EcsHostName"
},
"Engine": {
"Ref": "Engine"
},
"PasswordInherit": {
"Ref": "PasswordInherit"
},
"KeyPairName": {
"Ref": "KeyPairName"
},
"ZoneId": {
"Ref": "ZoneId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"SecurityGroupId": {
"Ref": "SecurityGroupId"
},
"ECSClassList": {
"Ref": "ECSClassList"
},
"Period": {
"Ref": "Period"
},
"PayType": {
"Ref": "PayType"
},
"InternetChargeType": {
"Ref": "InternetChargeType"
},
"EcsDeploymentSetId": {
"Ref": "EcsDeploymentSetId"
},
"InternetMaxBandwidthOut": {
"Ref": "InternetMaxBandwidthOut"
},
"VpcId": {
"Ref": "VpcId"
},
"OsPassword": {
"Ref": "OsPassword"
}
}
}
},
"Outputs": {
"OrderIds": {
"Description": "The order id list.",
"Value": {
"Fn::GetAtt": [
"MyBase",
"OrderIds"
]
}
},
"InstanceIds": {
"Description": "The instance id list of created ecs instances",
"Value": {
"Fn::GetAtt": [
"MyBase",
"InstanceIds"
]
}
}
}
}