ALIYUN::SWAS::Instance类型用于创建一台包年包月的轻量应用服务器实例。
语法
{
"Type": "ALIYUN::SWAS::Instance",
"Properties": {
"AutoRenewPeriod": Integer,
"PlanId": String,
"AutoRenew": Boolean,
"ImageId": String,
"Period": Integer,
"DataDiskSize": Integer,
"Tags": List
}
}
属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
ImageId |
String |
是 |
否 |
镜像ID。 |
您可以调用获取镜像列表查询指定地域下可用的镜像ID。 |
|
Period |
Integer |
是 |
否 |
购买资源的时长。 |
单位:月。 取值范围:{“1”,“3”,“6”,“12”,“24”,“36”}。 |
|
PlanId |
String |
是 |
否 |
套餐ID。 |
您可以调用获取套餐信息查询指定地域下的全部套餐信息。 |
|
AutoRenew |
Boolean |
否 |
否 |
是否开启到期自动续费。 |
取值:
|
|
AutoRenewPeriod |
Integer |
否 |
否 |
自动续费的时长。 |
单位:月。 取值范围:{“1”,“3”,“6”,“12”,“24”,“36”}。 仅当AutoRenew取值为true时,该参数必填。 |
|
DataDiskSize |
Integer |
否 |
否 |
挂载的数据盘容量大小。 |
单位:GB。 取值范围:0~16380,取值必须是20的整数倍。
默认值:0 |
|
Tags |
List |
否 |
是 |
标签列表。 |
更多信息,请参见Tags属性。 |
Tags语法
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Key |
String |
是 |
否 |
标签键。 |
无 |
|
Value |
String |
否 |
否 |
标签值。 |
无 |
返回值
Fn::GetAtt
-
PublicIpAddress:轻量应用服务器的公网IP地址。
-
InnerIpAddress:轻量应用服务器的内网IP地址。
-
InstanceId:轻量应用服务器的实例ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
AutoRenew:
Description:
en: 'Specifies whether to enable auto-renewal. Valid values:
true
false
Default value: false.'
Type: Boolean
AutoRenewPeriod:
Description:
en: 'The auto-renewal period. This parameter is required only when you set AutoRenew
to true. Unit: months. Valid values: 1, 3, 6, 12, 24, and 36.'
Type: Number
DataDiskSize:
Description:
en: 'The size of the data disk that is attached to the server. Unit: GB. Valid
values: 0 to 16380. The value must be an integral multiple of 20.
A value of 0 indicates that no data disk is attached.
If the disk included in the specified plan is a standard SSD, the data disk
must be 20 GB or larger in size.
Default value: 0.'
Type: Number
ImageId:
Description:
en: The image ID. You can call the ListImages operation to query the available
images in the specified region.
Type: String
Default: fe9c66133a9d4688872869726b52****
Period:
Description:
en: 'The subscription period of the servers. Unit: months. Valid values: 1,
3, 6, 12, 24, and 36.'
Type: Number
PlanId:
Description:
en: The plan ID. You can call the ListPlans operation to query all plans provided
by Simple Application Server in the specified region.
Type: String
Default: swas.s2.c2m1s40b3t04
Resources:
Instance:
Properties:
AutoRenew:
Ref: AutoRenew
AutoRenewPeriod:
Ref: AutoRenewPeriod
DataDiskSize:
Ref: DataDiskSize
ImageId:
Ref: ImageId
Period:
Ref: Period
PlanId:
Ref: PlanId
Type: ALIYUN::SWAS::Instance
Outputs:
InnerIpAddress:
Description: The inner IP address of simple application server.
Value:
Fn::GetAtt:
- Instance
- InnerIpAddress
InstanceId:
Description: The ID of the simple application server.
Value:
Fn::GetAtt:
- Instance
- InstanceId
PublicIpAddress:
Description: The public IP address of simple application server.
Value:
Fn::GetAtt:
- Instance
- PublicIpAddress{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"AutoRenew": {
"Description": {
"en": "Specifies whether to enable auto-renewal. Valid values: true false Default value: false."
},
"Type": "Boolean"
},
"AutoRenewPeriod": {
"Description": {
"en": "The auto-renewal period. This parameter is required only when you set AutoRenew to true. Unit: months. Valid values: 1, 3, 6, 12, 24, and 36."
},
"Type": "Number"
},
"DataDiskSize": {
"Description": {
"en": "The size of the data disk that is attached to the server. Unit: GB. Valid values: 0 to 16380. The value must be an integral multiple of 20. A value of 0 indicates that no data disk is attached. If the disk included in the specified plan is a standard SSD, the data disk must be 20 GB or larger in size. Default value: 0."
},
"Type": "Number"
},
"ImageId": {
"Description": {
"en": "The image ID. You can call the ListImages operation to query the available images in the specified region."
},
"Type": "String",
"Default": "fe9c66133a9d4688872869726b52****"
},
"Period": {
"Description": {
"en": "The subscription period of the servers. Unit: months. Valid values: 1, 3, 6, 12, 24, and 36."
},
"Type": "Number"
},
"PlanId": {
"Description": {
"en": "The plan ID. You can call the ListPlans operation to query all plans provided by Simple Application Server in the specified region."
},
"Type": "String",
"Default": "swas.s2.c2m1s40b3t04"
}
},
"Resources": {
"Instance": {
"Properties": {
"AutoRenew": {
"Ref": "AutoRenew"
},
"AutoRenewPeriod": {
"Ref": "AutoRenewPeriod"
},
"DataDiskSize": {
"Ref": "DataDiskSize"
},
"ImageId": {
"Ref": "ImageId"
},
"Period": {
"Ref": "Period"
},
"PlanId": {
"Ref": "PlanId"
}
},
"Type": "ALIYUN::SWAS::Instance"
}
},
"Outputs": {
"InnerIpAddress": {
"Description": "The inner IP address of simple application server.",
"Value": {
"Fn::GetAtt": [
"Instance",
"InnerIpAddress"
]
}
},
"InstanceId": {
"Description": "The ID of the simple application server.",
"Value": {
"Fn::GetAtt": [
"Instance",
"InstanceId"
]
}
},
"PublicIpAddress": {
"Description": "The public IP address of simple application server.",
"Value": {
"Fn::GetAtt": [
"Instance",
"PublicIpAddress"
]
}
}
}
}该文章对您有帮助吗?