-
Notifications
You must be signed in to change notification settings - Fork 35
/
ecs-instance-group-vpc.yml
336 lines (336 loc) · 10.5 KB
/
ecs-instance-group-vpc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 在新VPC环境中,自动部署同配置ECS实例,含VSwitch、安全组,支持自定义实例规格、镜像及计费方式。
en: In the new VPC environment, automatically deploy ECS instances with identical
configurations, including VSwitches and security groups, with support for custom
instance specifications, images, and billing methods.
Parameters:
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
VSwitchName:
Type: String
Label:
en: VSwitch Name
zh-cn: 交换机名称
Description:
en: VSwitch name, 2 to 128 characters in length, beginning with size letters
or Chinese characters, including Numbers, '_' or '-'.
zh-cn: 交换机名称,长度为2-128个字符,以大小字母或中文开头,可包含数字、“_”或“-”。
ConstraintDescription:
en: '[2, 128] English or Chinese characters'
zh-cn: '[2, 128] 英文或中文字符'
Default: MyVsw
MinLength: 2
MaxLength: 128
ZoneId:
Type: String
Label:
en: Zone ID
zh-cn: 可用区ID
Description:
en: The available zone ID, you should confirm the zone support ECS、VPC、VSwitch
or not.
zh-cn: 可用区ID,需确认所选可用区下是否支持ECS、VPC、VSwitch等资源。
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
SecurityGroupName:
Type: String
Label:
en: Security Group Name
zh-cn: 安全组名称
Description:
en: The security group name, consists of 2~128 letters, Chinese characters,
Numbers, dots (.), underscores (_) and hyphens (-).
zh-cn: 安全组名称,由2~128个字母、汉字、数字、点(.)、下划线(_)和连字符(-)组成。
Default: MySecurityGroup
InstanceName:
Type: String
Label:
en: Instance Name
zh-cn: 实例名称
Description:
en: '[2, 128] alphanumeric letters, underline, dot or hyphen.'
zh-cn: 实例名称。最长128个字符,可包含英文、中文、数字、下划线(_)、点号(.)和连字符(-)。
Default: MyECSInstance
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例类型
Description:
en: 'Fill in 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: ZoneId
ImageId:
Type: String
Label:
en: Image ID
zh-cn: 镜像ID
Description:
en: 'Instance Image ID. see detail: <b><a href=''https://www.alibabacloud.com/help/doc-detail/112977.html''
target=''_blank''><font color=''blue''>Find the mirror</font></a></b>'
zh-cn: 实例镜像,详见:<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: ${InternetChargeType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
InternetChargeType:
Type: String
Label:
en: Internet Charge Type
zh-cn: 公网计费方式
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
Password:
Type: String
Label:
en: Login Password
zh-cn: 实例密码
Description:
en: The 8-30 long login password of instance, consists of the uppercase, lowercase
letter and number. <br> special characters include()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
zh-cn: 长度8-30,必须包含大写字母、小写字母、数字、特殊符号三个;<br>特殊字符包括:()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
ConstraintDescription:
en: 'Length 8-30, must contain upper case letters, lower case letters, Numbers,
special symbols three; special characters include: ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/'
zh-cn: 长度8-30,必须包含大写字母、小写字母、数字、特殊符号三种;特殊字符包括:()`~!@#$%^&*_-+=|{}[]:;' <>,.?/
AllowedPattern: '[0-9A-Za-z\_\-&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
MaxAmount:
Type: Number
Label:
en: The number of instances
zh-cn: 实例数量
Description:
en: The maximum number of ECS instances created at a time.
zh-cn: 一次性创建ECS实例的最大数。
ConstraintDescription:
en: An integer within [1, 100]
zh-cn: '[1, 100] 内的整数'
Default: 1
MinValue: 1
MaxValue: 100
SystemDiskCategory:
Type: String
Label:
en: System Disk Category
zh-cn: 系统磁盘类别
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: ${InstanceType}
ZoneId: ${ZoneId}
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CidrBlock
zh-cn: VSwitch网段
Description:
en: VSwitch subnet which is within VPC.
zh-cn: 交换机网段,必须为VPC子网段。
Default: 192.168.1.0/24
VpcCidrBlock:
Type: String
Label:
en: VPC Cidrblock
zh-cn: VPC网段
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
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Ref: VpcName
Metadata:
ALIYUN::ROS::Designer:
id: c8300448-e463-4b40-968d-b9afac3e75a3
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupName:
Ref: SecurityGroupName
Metadata:
ALIYUN::ROS::Designer:
id: 0242106c-a2b2-4575-a76e-7e590bbea01d
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
VSwitchName:
Ref: VSwitchName
DependsOn: EcsVpc
Metadata:
ALIYUN::ROS::Designer:
id: 51015449-b074-4ede-886d-0be784db4510
EcsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageId
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
InternetChargeType:
Ref: InternetChargeType
IoOptimized: optimized
MaxAmount:
Ref: MaxAmount
Password:
Ref: Password
SystemDiskCategory:
Ref: SystemDiskCategory
Metadata:
ALIYUN::ROS::Designer:
id: 2a32c361-f386-42ba-a045-a78c2203d501
Outputs:
InstanceIds:
Description: The instance id list of created ecs instance
Value:
Fn::GetAtt:
- EcsInstanceGroup
- InstanceIds
PrivateIps:
Description: Private IP address list of created ecs instance. Only for VPC instance.
Value:
Fn::GetAtt:
- EcsInstanceGroup
- PrivateIps
PublicIps:
Description: Public IP address list of created ecs instance.
Value:
Fn::GetAtt:
- EcsInstanceGroup
- PublicIps
SecurityGroupId:
Description: Generated security group id for security group.
Value:
Fn::GetAtt:
- EcsSecurityGroup
- SecurityGroupId
ZoneIds:
Description: Zone ID of created instance.
Value:
Fn::GetAtt:
- EcsInstanceGroup
- ZoneIds
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcName
- VpcCidrBlock
- VSwitchName
- VSwitchCidrBlock
- ZoneId
Label:
default: VPC
- Parameters:
- SecurityGroupName
- InstanceName
- InstanceType
- ImageId
- InternetChargeType
- MaxAmount
- SystemDiskCategory
- Password
Label:
default: ECS
TemplateTags:
- acs:example:弹性计算:指定ImageId创建一组相同配置的ECS实例(已有VPC)
ALIYUN::ROS::Designer:
0242106c-a2b2-4575-a76e-7e590bbea01d:
position:
x: 278
y: 128
size:
height: 60
width: 60
z: 1
2a32c361-f386-42ba-a045-a78c2203d501:
position:
x: 128
y: 128
size:
height: 60
width: 60
z: 2
51015449-b074-4ede-886d-0be784db4510:
embeds:
- 2a32c361-f386-42ba-a045-a78c2203d501
position:
x: 89
y: 88
size:
height: 140
width: 120
z: 1
7e4f95fb-d8f4-4695-953c-cc7826cbf305:
source:
id: 2a32c361-f386-42ba-a045-a78c2203d501
target:
id: 0242106c-a2b2-4575-a76e-7e590bbea01d
z: 1
c8300448-e463-4b40-968d-b9afac3e75a3:
embeds:
- 0242106c-a2b2-4575-a76e-7e590bbea01d
- 51015449-b074-4ede-886d-0be784db4510
position:
x: 60
y: 8
size:
height: 288
width: 317.0537109375
z: 0