ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC下的ECS实例,含自定义网络配置、安全组、系统盘设置及公网访问选项。
en: Creating an ECS instance under a VPC, including custom network configurations, security group settings, system disk configurations, and options for public internet access.
Parameters:
VSwitchZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 交换机可用区
Description:
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>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
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>'
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>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
InstanceImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: Image ID,see detail:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find the mirror</font></a></b>
zh-cn: 镜像ID,详见:<b><a href='https://help.aliyun.com/document_detail/112977.html' target='_blank'><font color='blue'>查找镜像</font></a></b>
AssociationProperty: ALIYUN::ECS::Image::ImageId
AssociationPropertyMetadata:
InstanceType: ${InstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
SystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'System disk size, range of values: 20-500, units: GB.'
zh-cn: 系统盘大小, 取值范围:[20, 500], 单位:GB。
Default: 40
InstancePublicIP:
Type: Boolean
Label:
en: Allocate Public IP
zh-cn: 分配公网IP
Description:
en: Whether to assign a common IP.
zh-cn: 是否分配公共IP。
Default: false
InstancePassword:
Type: String
NoEcho: true
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AssociationProperty: ALIYUN::ECS::Instance::Password
SystemDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系统盘类型
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${InstanceType}
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupEgress:
- DestCidrIp: 0.0.0.0/0
IpProtocol: all
NicType: intranet
PortRange: '-1/-1'
Priority: 1
SecurityGroupIngress:
- IpProtocol: all
NicType: intranet
PortRange: '-1/-1'
Priority: 1
SourceCidrIp: 0.0.0.0/0
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock: 192.168.0.0/24
EcsInstance:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: InstanceImageId
AllocatePublicIP:
Ref: InstancePublicIP
InstanceType:
Ref: InstanceType
IoOptimized: optimized
Password:
Ref: InstancePassword
PrivateIpAddress: 192.168.0.1
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
Outputs:
EcsInstanceId:
Value:
Fn::GetAtt:
- EcsInstance
- InstanceId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VSwitchZoneId
- InstanceType
- InstanceImageId
- SystemDiskSize
- InstancePublicIP
- SystemDiskCategory
- InstancePassword
Label:
default: ECS
TemplateTags:
- acs:example:弹性计算:创建VPC网络下的ECS实例
ALIYUN::ROS::Composer:
450ea67e:
Rect:
- 520
- 410
- 40
- 100
- 1
- 0
ResT: Composer::ROSParameter::AlibabaCloud
8f422d83:
Parent: 450ea67e
Rect:
- 480
- 340
- 60
- 150
- 2
- 0
ResT: Composer::ROSParameter::Region
5f96ba9a:
Res:
- EcsVpc
Parent: 8f422d83
Rect:
- 440
- 270
- 80
- 200
- 3
- 0
0bb9d91e:
Res:
- EcsVSwitch
Parent: 5f96ba9a
Rect:
- 400
- 200
- 100
- 250
- 4
- 0
1cfb8ee6:
Res:
- EcsSecurityGroup
Parent: 5f96ba9a
Rect:
- 278
- 123
- 151
- 300
- 6
- 0
acea0722:
Res:
- EcsInstance
Parent: 0bb9d91e
Rect:
- 40
- 40
- 270
- 330
- 7
- 0
Layer:
- 1cfb8ee6