ALIYUN::ECS::VPC类型用于创建专有网络。
语法
{
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"Description": String,
"Tags": List,
"Ipv6CidrBlock": String,
"EnableIpv6": Boolean,
"ResourceGroupId": String,
"VpcName": String,
"CidrBlock": String,
"Ipv6Isp": String,
"UserCidr": String,
"SecondaryCidrBlocks": List
}
}属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ResourceGroupId | String | 否 | 是 | 资源组ID。 | 无 |
VpcName | String | 否 | 是 | 专有网络名称。 | 长度为2~128个字符。必须以英文字母或汉字开头,不能以 |
CidrBlock | String | 否 | 是 | 专有网络网段。 | 取值:
|
Description | String | 否 | 是 | 专有网络描述。 | 长度为2~256个字符。不能以 |
Ipv6CidrBlock | String | 否 | 否 | 专有网络的IPv6网段。 | 无 |
EnableIpv6 | Boolean | 否 | 是 | 是否开启IPv6网段。 | 取值:
|
Tags | List | 否 | 是 | 标签。 | 最多支持20个标签。 更多信息,请参见Tags属性。 |
Ipv6Isp | String | 否 | 否 | 专有网络的IPv6地址段类型。 | 取值:
说明 如果是开通了单线带宽白名单的用户,该参数可以设置为ChinaTelecom(中国电信)、ChinaUnicom(中国联通)和ChinaMobile(中国移动)。 |
UserCidr | String | 否 | 否 | 用户网段。 | 如需定义多个网段,请使用半角逗号(,)分隔。最多支持3个网段。 说明 关于用户网段的更多信息,请参见网段常见问题。 |
SecondaryCidrBlocks | List | 否 | 否 | SecondaryCidrBlocks。 | 无 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
] Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Key | String | 是 | 否 | 标签键。 | 长度为1~128个字符,不能以 |
Value | String | 否 | 否 | 标签值。 | 长度为0~128个字符,不能以 |
返回值
Fn::GetAtt
VpcId:专有网络ID。
VRouterId:路由器ID。
RouteTableId:路由表ID。
VpcName:专有网络名称。
示例
场景 1 :创建VPC专有网络。
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR IPv4 Block
zh-cn: 专有网络IPv4网段
Description:
zh-cn: VPC的ip地址段范围,<br>您可以使用以下的ip地址段或其子网:<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
en: 'The ip address range of the VPC in the CidrBlock form; <br>You can use the following ip address ranges and their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
Default: 192.168.0.0/16
AssociationProperty: ALIYUN::VPC::VPC::CidrBlock
VpcName:
Type: String
Label:
en: VPC Name
zh-cn: 虚拟专有网络名称
Description:
en: VPC name, 2 to 128 characters in length, beginning with size letters or Chinese characters, including Numbers, '_' or '-'.
zh-cn: VPC名称,长度为2-128个字符,以大小字母或中文开头,可包含数字、“_”或“-”。
ConstraintDescription:
en: '[2, 128] English or Chinese characters'
zh-cn: '[2, 128] 英文或中文字符'
Default: MyVpc
MinLength: 2
MaxLength: 128
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Ref: VpcName
Outputs:
VRouterId:
Description: Router id of created VPC.
Value:
Fn::GetAtt:
- Vpc
- VRouterId
RouteTableId:
Description: The router table id of created VPC.
Value:
Fn::GetAtt:
- Vpc
- RouteTableId
VpcId:
Description: Id of created VPC.
Value:
Fn::GetAtt:
- Vpc
- VpcId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcCidrBlock": {
"Type": "String",
"Label": {
"en": "VPC CIDR IPv4 Block",
"zh-cn": "专有网络IPv4网段"
},
"Description": {
"zh-cn": "VPC的ip地址段范围,<br>您可以使用以下的ip地址段或其子网:<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>",
"en": "The ip address range of the VPC in the CidrBlock form; <br>You can use the following ip address ranges and their subnets: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
},
"Default": "192.168.0.0/16",
"AssociationProperty": "ALIYUN::VPC::VPC::CidrBlock"
},
"VpcName": {
"Type": "String",
"Label": {
"en": "VPC Name",
"zh-cn": "虚拟专有网络名称"
},
"Description": {
"en": "VPC name, 2 to 128 characters in length, beginning with size letters or Chinese characters, including Numbers, '_' or '-'.",
"zh-cn": "VPC名称,长度为2-128个字符,以大小字母或中文开头,可包含数字、“_”或“-”。"
},
"ConstraintDescription": {
"en": "[2, 128] English or Chinese characters",
"zh-cn": "[2, 128] 英文或中文字符"
},
"Default": "MyVpc",
"MinLength": 2,
"MaxLength": 128
}
},
"Resources": {
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": {
"Ref": "VpcCidrBlock"
},
"VpcName": {
"Ref": "VpcName"
}
}
}
},
"Outputs": {
"VRouterId": {
"Description": "Router id of created VPC.",
"Value": {
"Fn::GetAtt": [
"Vpc",
"VRouterId"
]
}
},
"RouteTableId": {
"Description": "The router table id of created VPC.",
"Value": {
"Fn::GetAtt": [
"Vpc",
"RouteTableId"
]
}
},
"VpcId": {
"Description": "Id of created VPC.",
"Value": {
"Fn::GetAtt": [
"Vpc",
"VpcId"
]
}
}
}
}场景 2 :创建一台IPv4&IPv6双栈的ECS实例,并配置IPv6网关及带宽。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建双栈云服务器(ECS),自动配置IPv6公网IP,含VPC、安全组、IPv6网关及带宽设置。
en: Create a dual-stack cloud server (ECS) and automatically configure IPv6 public IP, including VPC, security group, IPv6 gateway and bandwidth settings.
Parameters:
InstanceImageId:
AssociationPropertyMetadata:
InstanceType: ${InstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Description:
zh-cn: 镜像ID, <br>Linux系统请选择:<font color='red'><b>centos_7</b></font> <br>Windows系统请选择:<font color='red'><b>win2008r2;win2012r2;win2016</b></font>
en: Image ID,<br>Linux System Select:<font color='red'><b>centos_7</b></font> <br>Windows System Select:<font color='red'><b>win2008r2;win2012r2;win2016</b></font>
Default: centos_7_04_64_20G_alibase_201701015.vhd
Label:
zh-cn: 镜像
en: Image
AssociationProperty: ALIYUN::ECS::Image::ImageId
Type: String
SystemDiskCategory:
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${InstanceType}
Type: String
Description:
zh-cn: '<font color=''blue''><b>可选值:</b></font><br>[cloud_efficiency: <font color=''green''>高效云盘</font>]<br>[cloud_ssd: <font color=''green''>SSD云盘</font>]<br>[cloud_essd: <font color=''green''>ESSD云盘</font>]<br>[cloud: <font color=''green''>普通云盘</font>]<br>[ephemeral_ssd: <font color=''green''>本地SSD盘</font>]'
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency: <font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud: <font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD Cloud Disk</font>]'
Label:
zh-cn: 系统盘类型
en: System Disk Type
SystemDiskSize:
Default: 40
Type: Number
Description:
zh-cn: 系统盘大小, 取值范围:[20, 500], 单位:GB。
en: 'System disk size, range of values: 20-500, units: GB.'
Label:
zh-cn: 系统盘空间
en: System Disk Space
VpcCidrBlock:
Default: 192.168.0.0/16
Label:
zh-cn: 专有网络IPV4网段
en: VPC IPV4 CIDR Block
Type: String
Description:
zh-cn: 新建专有网络IP地址段范围,推荐使用以下的IP地址段<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
en: New proprietary network IP address segment range, recommended use of the following IP address segments<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
InstanceType:
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
Type: String
Description:
zh-cn: 填写VSwitch可用区下可使用的规格;<br>通用规格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font color='blue'>实例规格族</font></a></b>
en: 'Fill in the specifications that can be used under the VSwitch availability zone;</b></font><br>general specifications:<font color=''red''><b>ecs.c5.large</b></font><br>note: a few zones do not support general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html'' target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
Label:
zh-cn: 实例规格
en: Instance Type
InstancePassword:
Description:
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
Type: String
Label:
zh-cn: 实例密码
en: Instance Password
NoEcho: true
AssociationProperty: ALIYUN::ECS::Instance::Password
ConstraintDescription:
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
VSwitchCidrBlock:
Default: 192.168.0.0/24
Type: String
Description:
zh-cn: 新建交换机的网段,所属虚拟专有网络的子网
en: Network segments of new switches, subnets of virtual proprietary networks
Label:
zh-cn: 交换机IPV4网段
en: VSwitch IPV4 CIDR Block
InternetChargeType:
Default: PayByBandwidth
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Label:
zh-cn: IPv6公网带宽的计费方式
en: IPv6 Metric Bandwidth Metering Method.
Type: String
AllowedValues:
- PayByTraffic
- PayByBandwidth
IPV6Bandwidth:
Default: 10
Type: Number
Description:
zh-cn: IPv6网关公网带宽, 取值范围:[1, 5000], 单位:Mbps。当公网带宽计费方式为按使用流量计费时取值范围为1~2000Mbps,当公网带宽计费方式为按带宽计费时取值范围为1~5000Mbps。
en: 'IPv6 network Gateway public network bandwidth, value range: s1, 5000, in Mbps. When the public network bandwidth billing method is based on the use of traffic billing value range of 1 to 2000Mbps, when the public network bandwidth billing method is metered by bandwidth when the value range is 1 to 5000Mbps.'
Label:
zh-cn: IPv6网关公网带宽
en: IPv6 Network Gateway Public Network Bandwidth
VSwitchZoneId:
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
Type: String
Description:
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources,which is recommended to be different from other VSwitch Availability Zone</font></b>
Label:
zh-cn: 交换机可用区
en: VSwitch Availability Zone
InstancePublicIP:
Default: false
Type: Boolean
Description:
zh-cn: 是否分配IPV4公共IP。
en: Whether to assign a IPV4 common IP.
Label:
zh-cn: 分配IPV4公网IP
en: Allocate IPV4 Public IP
IPV6GateWaySpec:
AssociationPropertyMetadata:
LocaleKey: NatGatewaySpec
Description:
zh-cn: IPv6网关的规格,可选值:Small(免费版),Medium(企业版),Large(企业增强版)
en: 'IPv6 gateway specifications, optional values: Small (free version), Medium (enterprise version), Large (enterprise enhancement version)'
Default: Small
Label:
zh-cn: IPv6网关的规格
en: Specifications for the IPv6 Gateway
AllowedValues:
- Small
- Medium
- Large
Type: String
Outputs:
EcsInstanceId:
Description: EcsInstance InstanceId
Value:
Fn::GetAtt:
- EcsInstance
- InstanceId
EcsInstancePrivateIp:
Description: EcsInstance PrivateIp
Value:
Fn::GetAtt:
- EcsInstance
- PrivateIp
EcsInstanceIpv6Address:
Description: EcsInstance Ipv6Address
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsAssignIpv6Addresses
- Ipv6Addresses
Conditions: {}
Resources:
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
SecurityGroupIngress:
- Priority: 1
IpProtocol: tcp
NicType: intranet
SourceCidrIp: 0.0.0.0/0
PortRange: 3389/3389
- Priority: 1
IpProtocol: all
NicType: intranet
Ipv6SourceCidrIp: '::/0'
PortRange: '-1/-1'
VpcId:
Ref: EcsVpc
SecurityGroupEgress:
- Priority: 1
IpProtocol: tcp
DestCidrIp: 0.0.0.0/0
NicType: intranet
PortRange: 3389/3389
- Ipv6DestCidrIp: '::/0'
IpProtocol: all
Priority: 1
NicType: intranet
PortRange: '-1/-1'
WaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
VpcIpv6InternetBandwidth:
Type: ALIYUN::VPC::Ipv6InternetBandwidth
Properties:
InternetChargeType:
Ref: InternetChargeType
Bandwidth:
Ref: IPV6Bandwidth
Ipv6AddressId:
Fn::Select:
- 0
- Fn::GetAtt:
- EcsAssignIpv6Addresses
- Ipv6AddressIds
Ipv6GatewayId:
Ref: VpcIpv6Gateway
DependsOn:
- EcsAssignIpv6Addresses
- VpcIpv6Gateway
VpcIpv6Gateway:
Type: ALIYUN::VPC::Ipv6Gateway
Properties:
VpcId:
Ref: EcsVpc
Name: MyIpv6Gateway
Spec:
Ref: IPV6GateWaySpec
EcsAssignIpv6Addresses:
Type: ALIYUN::ECS::AssignIpv6Addresses
Properties:
NetworkInterfaceId:
Fn::GetAtt:
- EcsInstance
- PrimaryNetworkInterfaceId
Ipv6AddressCount: 1
DependsOn:
- EcsInstance
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
Ipv6CidrBlock: 0
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
ZoneId:
Ref: VSwitchZoneId
WaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: WaitConditionHandle
Timeout: 900
EcsInstance:
Type: ALIYUN::ECS::Instance
Properties:
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- WaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - '#!/bin/sh'
- |2
- |
cd /opt
- |
wget http://ecs-image-utils.oss-cn-hangzhou.aliyuncs.com/ipv6/rhel/ecs-utils-ipv6
- |
chmod +x ./ecs-utils-ipv6
- |
./ecs-utils-ipv6
- |
ros-notify -d "{\"Data\" : \"SUCCESS\", \"Status\" : \"SUCCESS\"}"
SystemDiskCategory:
Ref: SystemDiskCategory
VpcId:
Ref: EcsVpc
SecurityGroupId:
Ref: EcsSecurityGroup
SystemDiskSize:
Ref: SystemDiskSize
ImageId:
Ref: InstanceImageId
AllocatePublicIP:
Ref: InstancePublicIP
VSwitchId:
Ref: EcsVSwitch
IoOptimized: optimized
Password:
Ref: InstancePassword
InstanceType:
Ref: InstanceType
DependsOn:
- EcsSecurityGroup
- EcsVSwitch
- EcsVpc
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
EnableIpv6: true
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchCidrBlock
- VSwitchZoneId
- InstanceType
- InstanceImageId
- SystemDiskSize
- InstancePublicIP
- InternetChargeType
- IPV6Bandwidth
- IPV6GateWaySpec
- SystemDiskCategory
- InstancePassword
Label:
default: ECS
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建双栈云服务器(ECS),自动配置IPv6公网IP,含VPC、安全组、IPv6网关及带宽设置。",
"en": "Create a dual-stack cloud server (ECS) and automatically configure IPv6 public IP, including VPC, security group, IPv6 gateway and bandwidth settings."
},
"Parameters": {
"InstanceImageId": {
"AssociationPropertyMetadata": {
"InstanceType": "${InstanceType}",
"SupportedImageOwnerAlias": [
"system",
"self",
"others"
]
},
"Description": {
"zh-cn": "镜像ID, <br>Linux系统请选择:<font color='red'><b>centos_7</b></font> <br>Windows系统请选择:<font color='red'><b>win2008r2;win2012r2;win2016</b></font>",
"en": "Image ID,<br>Linux System Select:<font color='red'><b>centos_7</b></font> <br>Windows System Select:<font color='red'><b>win2008r2;win2012r2;win2016</b></font>"
},
"Default": "centos_7_04_64_20G_alibase_201701015.vhd",
"Label": {
"zh-cn": "镜像",
"en": "Image"
},
"AssociationProperty": "ALIYUN::ECS::Image::ImageId",
"Type": "String"
},
"SystemDiskCategory": {
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"LocaleKey": "DiskCategory",
"InstanceType": "${InstanceType}"
},
"Type": "String",
"Description": {
"zh-cn": "<font color='blue'><b>可选值:</b></font><br>[cloud_efficiency: <font color='green'>高效云盘</font>]<br>[cloud_ssd: <font color='green'>SSD云盘</font>]<br>[cloud_essd: <font color='green'>ESSD云盘</font>]<br>[cloud: <font color='green'>普通云盘</font>]<br>[ephemeral_ssd: <font color='green'>本地SSD盘</font>]",
"en": "<font color='blue'><b>Optional values:</b></font><br>[cloud_efficiency: <font color='green'>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color='green'>SSD Cloud Disk</font>]<br>[cloud_essd: <font color='green'>ESSD Cloud Disk</font>]<br>[cloud: <font color='green'>Cloud Disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD Cloud Disk</font>]"
},
"Label": {
"zh-cn": "系统盘类型",
"en": "System Disk Type"
}
},
"SystemDiskSize": {
"Default": 40,
"Type": "Number",
"Description": {
"zh-cn": "系统盘大小, 取值范围:[20, 500], 单位:GB。",
"en": "System disk size, range of values: 20-500, units: GB."
},
"Label": {
"zh-cn": "系统盘空间",
"en": "System Disk Space"
}
},
"VpcCidrBlock": {
"Default": "192.168.0.0/16",
"Label": {
"zh-cn": "专有网络IPV4网段",
"en": "VPC IPV4 CIDR Block"
},
"Type": "String",
"Description": {
"zh-cn": "新建专有网络IP地址段范围,推荐使用以下的IP地址段<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>",
"en": "New proprietary network IP address segment range, recommended use of the following IP address segments<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
},
"AllowedValues": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8"
]
},
"InstanceType": {
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "VSwitchZoneId"
},
"Type": "String",
"Description": {
"zh-cn": "填写VSwitch可用区下可使用的规格;<br>通用规格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font color='blue'>实例规格族</font></a></b>",
"en": "Fill in the specifications that can be used under the VSwitch availability zone;</b></font><br>general specifications:<font color='red'><b>ecs.c5.large</b></font><br>note: a few zones do not support general specifications<br>see detail: <a href='https://www.alibabacloud.com/help/en/doc-detail/25378.html' target='_blank'><b><font color='blue'>Instance Specification Family</font></a></b>"
},
"Label": {
"zh-cn": "实例规格",
"en": "Instance Type"
}
},
"InstancePassword": {
"Description": {
"zh-cn": "服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。",
"en": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)."
},
"Type": "String",
"Label": {
"zh-cn": "实例密码",
"en": "Instance Password"
},
"NoEcho": true,
"AssociationProperty": "ALIYUN::ECS::Instance::Password",
"ConstraintDescription": {
"zh-cn": "长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。",
"en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)."
}
},
"VSwitchCidrBlock": {
"Default": "192.168.0.0/24",
"Type": "String",
"Description": {
"zh-cn": "新建交换机的网段,所属虚拟专有网络的子网",
"en": "Network segments of new switches, subnets of virtual proprietary networks"
},
"Label": {
"zh-cn": "交换机IPV4网段",
"en": "VSwitch IPV4 CIDR Block"
}
},
"InternetChargeType": {
"Default": "PayByBandwidth",
"AssociationPropertyMetadata": {
"LocaleKey": "InternetChargeType"
},
"Label": {
"zh-cn": "IPv6公网带宽的计费方式",
"en": "IPv6 Metric Bandwidth Metering Method."
},
"Type": "String",
"AllowedValues": [
"PayByTraffic",
"PayByBandwidth"
]
},
"IPV6Bandwidth": {
"Default": 10,
"Type": "Number",
"Description": {
"zh-cn": "IPv6网关公网带宽, 取值范围:[1, 5000], 单位:Mbps。当公网带宽计费方式为按使用流量计费时取值范围为1~2000Mbps,当公网带宽计费方式为按带宽计费时取值范围为1~5000Mbps。",
"en": "IPv6 network Gateway public network bandwidth, value range: s1, 5000, in Mbps. When the public network bandwidth billing method is based on the use of traffic billing value range of 1 to 2000Mbps, when the public network bandwidth billing method is metered by bandwidth when the value range is 1 to 5000Mbps."
},
"Label": {
"zh-cn": "IPv6网关公网带宽",
"en": "IPv6 Network Gateway Public Network Bandwidth"
}
},
"VSwitchZoneId": {
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
"Type": "String",
"Description": {
"zh-cn": "可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>",
"en": "Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources,which is recommended to be different from other VSwitch Availability Zone</font></b>"
},
"Label": {
"zh-cn": "交换机可用区",
"en": "VSwitch Availability Zone"
}
},
"InstancePublicIP": {
"Default": false,
"Type": "Boolean",
"Description": {
"zh-cn": "是否分配IPV4公共IP。",
"en": "Whether to assign a IPV4 common IP."
},
"Label": {
"zh-cn": "分配IPV4公网IP",
"en": "Allocate IPV4 Public IP"
}
},
"IPV6GateWaySpec": {
"AssociationPropertyMetadata": {
"LocaleKey": "NatGatewaySpec"
},
"Description": {
"zh-cn": "IPv6网关的规格,可选值:Small(免费版),Medium(企业版),Large(企业增强版)",
"en": "IPv6 gateway specifications, optional values: Small (free version), Medium (enterprise version), Large (enterprise enhancement version)"
},
"Default": "Small",
"Label": {
"zh-cn": "IPv6网关的规格",
"en": "Specifications for the IPv6 Gateway"
},
"AllowedValues": [
"Small",
"Medium",
"Large"
],
"Type": "String"
}
},
"Outputs": {
"EcsInstanceId": {
"Description": "EcsInstance InstanceId",
"Value": {
"Fn::GetAtt": [
"EcsInstance",
"InstanceId"
]
}
},
"EcsInstancePrivateIp": {
"Description": "EcsInstance PrivateIp",
"Value": {
"Fn::GetAtt": [
"EcsInstance",
"PrivateIp"
]
}
},
"EcsInstanceIpv6Address": {
"Description": "EcsInstance Ipv6Address",
"Value": {
"Fn::Select": [
"0",
{
"Fn::GetAtt": [
"EcsAssignIpv6Addresses",
"Ipv6Addresses"
]
}
]
}
}
},
"Conditions": {},
"Resources": {
"EcsSecurityGroup": {
"Type": "ALIYUN::ECS::SecurityGroup",
"Properties": {
"SecurityGroupIngress": [
{
"Priority": 1,
"IpProtocol": "tcp",
"NicType": "intranet",
"SourceCidrIp": "0.0.0.0/0",
"PortRange": "3389/3389"
},
{
"Priority": 1,
"IpProtocol": "all",
"NicType": "intranet",
"Ipv6SourceCidrIp": "::/0",
"PortRange": "-1/-1"
}
],
"VpcId": {
"Ref": "EcsVpc"
},
"SecurityGroupEgress": [
{
"Priority": 1,
"IpProtocol": "tcp",
"DestCidrIp": "0.0.0.0/0",
"NicType": "intranet",
"PortRange": "3389/3389"
},
{
"Ipv6DestCidrIp": "::/0",
"IpProtocol": "all",
"Priority": 1,
"NicType": "intranet",
"PortRange": "-1/-1"
}
]
}
},
"WaitConditionHandle": {
"Type": "ALIYUN::ROS::WaitConditionHandle",
"Properties": {}
},
"VpcIpv6InternetBandwidth": {
"Type": "ALIYUN::VPC::Ipv6InternetBandwidth",
"Properties": {
"InternetChargeType": {
"Ref": "InternetChargeType"
},
"Bandwidth": {
"Ref": "IPV6Bandwidth"
},
"Ipv6AddressId": {
"Fn::Select": [
0,
{
"Fn::GetAtt": [
"EcsAssignIpv6Addresses",
"Ipv6AddressIds"
]
}
]
},
"Ipv6GatewayId": {
"Ref": "VpcIpv6Gateway"
}
},
"DependsOn": [
"EcsAssignIpv6Addresses",
"VpcIpv6Gateway"
]
},
"VpcIpv6Gateway": {
"Type": "ALIYUN::VPC::Ipv6Gateway",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"Name": "MyIpv6Gateway",
"Spec": {
"Ref": "IPV6GateWaySpec"
}
}
},
"EcsAssignIpv6Addresses": {
"Type": "ALIYUN::ECS::AssignIpv6Addresses",
"Properties": {
"NetworkInterfaceId": {
"Fn::GetAtt": [
"EcsInstance",
"PrimaryNetworkInterfaceId"
]
},
"Ipv6AddressCount": 1
},
"DependsOn": [
"EcsInstance"
]
},
"EcsVSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"Ipv6CidrBlock": 0,
"VpcId": {
"Ref": "EcsVpc"
},
"CidrBlock": {
"Ref": "VSwitchCidrBlock"
},
"ZoneId": {
"Ref": "VSwitchZoneId"
}
}
},
"WaitCondition": {
"Type": "ALIYUN::ROS::WaitCondition",
"Properties": {
"Count": 1,
"Handle": {
"Ref": "WaitConditionHandle"
},
"Timeout": 900
}
},
"EcsInstance": {
"Type": "ALIYUN::ECS::Instance",
"Properties": {
"UserData": {
"Fn::Replace": [
{
"ros-notify": {
"Fn::GetAtt": [
"WaitConditionHandle",
"CurlCli"
]
}
},
{
"Fn::Join": [
"",
[
"#!/bin/sh",
" \n",
"cd /opt \n",
"wget http://ecs-image-utils.oss-cn-hangzhou.aliyuncs.com/ipv6/rhel/ecs-utils-ipv6 \n",
"chmod +x ./ecs-utils-ipv6 \n",
"./ecs-utils-ipv6 \n",
"ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" : \\\"SUCCESS\\\"}\" \n"
]
]
}
]
},
"SystemDiskCategory": {
"Ref": "SystemDiskCategory"
},
"VpcId": {
"Ref": "EcsVpc"
},
"SecurityGroupId": {
"Ref": "EcsSecurityGroup"
},
"SystemDiskSize": {
"Ref": "SystemDiskSize"
},
"ImageId": {
"Ref": "InstanceImageId"
},
"AllocatePublicIP": {
"Ref": "InstancePublicIP"
},
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"IoOptimized": "optimized",
"Password": {
"Ref": "InstancePassword"
},
"InstanceType": {
"Ref": "InstanceType"
}
},
"DependsOn": [
"EcsSecurityGroup",
"EcsVSwitch",
"EcsVpc"
]
},
"EcsVpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": {
"Ref": "VpcCidrBlock"
},
"VpcName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
},
"EnableIpv6": true
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"VpcCidrBlock",
"VSwitchCidrBlock",
"VSwitchZoneId",
"InstanceType",
"InstanceImageId",
"SystemDiskSize",
"InstancePublicIP",
"InternetChargeType",
"IPV6Bandwidth",
"IPV6GateWaySpec",
"SystemDiskCategory",
"InstancePassword"
],
"Label": {
"default": "ECS"
}
}
]
}
}
}场景 3 :创建一个VPC类型的传统型负载均衡(CLB)实例。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC与VSwitch,配置内网SLB,支持指定规格与地址类型。
en: Create a Virtual Private Cloud (VPC) and Virtual Switch (VSwitch), configure an internal Load Balancer (SLB), with support for specifying instance types and address types.
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
zh-cn: 专有网络的网段,可选值:10.0.0.0/8,172.16.0.0/12,192.168.0.0/16。
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchZoneId:
Type: String
Label:
en: Zone ID
zh-cn: 可用区ID
Default: Null
Description:
en: The available zone ID, you should confirm the zone support SLB or not.
zh-cn: 可用区ID,需确认所选可用区下是否支持SLB等资源。
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.0.0/24
LoadBalancerSpec:
Type: String
Label:
en: Specification
zh-cn: 规格
Description:
en: Load balancing specification, <a href='https://help.aliyun.com/document_detail/85939.html' target='_blank'><font color='blue'><b>Slb spec detail</b></font>.</a>
zh-cn: 负载均衡规格,<a href='https://help.aliyun.com/document_detail/85939.html' target='_blank'><font color='blue'><b>规格详情</b></font></a>。
Default: slb.s1.small
Conditions: {}
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
VSwitchName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
SlbLoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
AddressType: intranet
LoadBalancerName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
LoadBalancerSpec:
Ref: LoadBalancerSpec
PayType: PayOnDemand
DependsOn: EcsVSwitch
Outputs:
SlbLoadBalancerId:
Description:
en: The ID of load balance created.
zh-cn: 创建的负载均衡ID。
Value:
Fn::GetAtt:
- SlbLoadBalancer
- LoadBalancerId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchZoneId
- VSwitchCidrBlock
Label:
default:
en: VPC
zh-cn: 专有网络
- Parameters:
- LoadBalancerSpec
Label:
default:
en: SLB
zh-cn: 负载均衡
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建VPC与VSwitch,配置内网SLB,支持指定规格与地址类型。",
"en": "Create a Virtual Private Cloud (VPC) and Virtual Switch (VSwitch), configure an internal Load Balancer (SLB), with support for specifying instance types and address types."
},
"Parameters": {
"VpcCidrBlock": {
"Type": "String",
"Label": {
"en": "VPC CIDR Block",
"zh-cn": "专有网络网段"
},
"Description": {
"en": "The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16",
"zh-cn": "专有网络的网段,可选值:10.0.0.0/8,172.16.0.0/12,192.168.0.0/16。"
},
"Default": "192.168.0.0/16",
"AllowedValues": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8"
]
},
"VSwitchZoneId": {
"Type": "String",
"Label": {
"en": "Zone ID",
"zh-cn": "可用区ID"
},
"Default": null,
"Description": {
"en": "The available zone ID, you should confirm the zone support SLB or not.",
"zh-cn": "可用区ID,需确认所选可用区下是否支持SLB等资源。"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"VSwitchCidrBlock": {
"Type": "String",
"Label": {
"en": "VSwitch CIDR Block",
"zh-cn": "交换机网段"
},
"Description": {
"en": "Must be a sub-network segment of the proprietary network and is not occupied by other VSwitches.",
"zh-cn": "必须是所属专有网络的子网段,并且没有被其他交换机占用。"
},
"Default": "192.168.0.0/24"
},
"LoadBalancerSpec": {
"Type": "String",
"Label": {
"en": "Specification",
"zh-cn": "规格"
},
"Description": {
"en": "Load balancing specification, <a href='https://help.aliyun.com/document_detail/85939.html' target='_blank'><font color='blue'><b>Slb spec detail</b></font>.</a>",
"zh-cn": "负载均衡规格,<a href='https://help.aliyun.com/document_detail/85939.html' target='_blank'><font color='blue'><b>规格详情</b></font></a>。"
},
"Default": "slb.s1.small"
}
},
"Conditions": {},
"Resources": {
"EcsVpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": {
"Ref": "VpcCidrBlock"
},
"VpcName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
}
}
},
"EcsVSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"ZoneId": {
"Ref": "VSwitchZoneId"
},
"VpcId": {
"Ref": "EcsVpc"
},
"CidrBlock": {
"Ref": "VSwitchCidrBlock"
},
"VSwitchName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
}
}
},
"SlbLoadBalancer": {
"Type": "ALIYUN::SLB::LoadBalancer",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"AddressType": "intranet",
"LoadBalancerName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
},
"LoadBalancerSpec": {
"Ref": "LoadBalancerSpec"
},
"PayType": "PayOnDemand"
},
"DependsOn": "EcsVSwitch"
}
},
"Outputs": {
"SlbLoadBalancerId": {
"Description": {
"en": "The ID of load balance created.",
"zh-cn": "创建的负载均衡ID。"
},
"Value": {
"Fn::GetAtt": [
"SlbLoadBalancer",
"LoadBalancerId"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"VpcCidrBlock",
"VSwitchZoneId",
"VSwitchCidrBlock"
],
"Label": {
"default": {
"en": "VPC",
"zh-cn": "专有网络"
}
}
},
{
"Parameters": [
"LoadBalancerSpec"
],
"Label": {
"default": {
"en": "SLB",
"zh-cn": "负载均衡"
}
}
}
]
}
}
}更多示例,请参考包含此资源的公共模板。