-
Notifications
You must be signed in to change notification settings - Fork 35
/
ecs-multi-dynamic-ip.yml
416 lines (416 loc) · 12.4 KB
/
ecs-multi-dynamic-ip.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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建ECS实例,配置VPC、安全组、多IP地址、系统盘及网络接口,支持自定义实例规格、镜像和网络设置。
en: Create an ECS instance, configure VPC, security group, multiple IP addresses, system disk and network interface, and support customizing instance specifications, mirroring and network settings.
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</font></b>
zh-cn: 可用区ID,<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
IpAddressCount:
Type: Number
Label:
en: Number of IPv4 Network Card
zh-cn: 网卡分配IPv4数量
Description:
en: 'Allowed values: 1~9.'
zh-cn: 取值范围:1-9。
Default: 1
MinValue: 1
MaxValue: 9
EcsImageId:
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: ${EcsInstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
EcsInstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
en: <font color='blue'><b>1.Before selecting the model please confirm that the
current available zone under the model is in stock, some models need to be
reported in advance</b></font><br><font color='blue'><b>2.List of optional
models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet
bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge
<font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and
receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU
16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
zh-cn: <font color='blue'><b>1.选择机型前请先确认当前可用区下该机型是否有货,部分机型需要提前报备</b></font><br><font
color='blue'><b>2.可选机型列表</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU
4GiB 内网带宽1Gbps 内网收发包30万PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU
8GiB 内网带宽1.5Gbps 内网收发包50万PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU
16GiB 内网带宽2.5Gbps 内网收发包80万PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
EcsSystemDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系统盘类型
Description:
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>]'
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>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${EcsInstanceType}
EcsSystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'System disk size, range of values: 40-500, units: GB.'
zh-cn: 系统盘大小, 取值范围:[40, 500], 单位:GB。
Default: 40
EcsPassword:
Type: String
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,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: bf76b814-edf4-4cb9-a6d7-2adacbc72337
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- _
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 13b8c8c2-d5a5-4f80-9d21-1a78d8911c86
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock: 192.168.0.0/24
VSwitchName:
Fn::Join:
- _
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: dcd718f2-7ab6-401e-b622-25df42d5d461
EcsENI:
Type: ALIYUN::ECS::NetworkInterface
Properties:
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
Metadata:
ALIYUN::ROS::Designer:
id: aaf6f751-deac-4c47-a366-88cab6fc431c
EcsAssignPrivateIpAddresses:
Type: ALIYUN::ECS::AssignPrivateIpAddresses
Properties:
NetworkInterfaceId:
Ref: EcsENI
SecondaryPrivateIpAddressCount:
Ref: IpAddressCount
DependsOn:
- EcsENI
Metadata:
ALIYUN::ROS::Designer:
id: 3e443b09-2a46-47d4-aaaf-3eb419e959ee
EcsInstance:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: EcsImageId
AllocatePublicIP: false
InstanceChargeType: PostPaid
InstanceType:
Ref: EcsInstanceType
IoOptimized: optimized
MaxAmount: 1
Password:
Ref: EcsPassword
SystemDiskCategory:
Ref: EcsSystemDiskCategory
SystemDiskSize:
Ref: EcsSystemDiskSize
Metadata:
ALIYUN::ROS::Designer:
id: cba01acc-c736-4252-bb81-f228f9a55a69
Eip:
Type: ALIYUN::VPC::EIP
Properties:
InstanceChargeType: Postpaid
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: acc4c898-a27c-426a-be34-f40ece62b47d
EipAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: EcsENI
AllocationId:
Ref: Eip
Mode: NAT
DependsOn:
- EcsAssignPrivateIpAddresses
- Eip
Metadata:
ALIYUN::ROS::Designer:
id: e53e0396-80f0-4462-95a5-a8af705b936e
EcsEniAttachment:
Type: ALIYUN::ECS::NetworkInterfaceAttachment
Properties:
NetworkInterfaceId:
Ref: EcsENI
InstanceId:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstance
- InstanceIds
DependsOn:
- EcsInstance
- EipAssociation
Metadata:
ALIYUN::ROS::Designer:
id: 6515e962-974b-481d-a6da-e3c82ecc97ed
Outputs:
AddPrivateIPAddressList:
Value:
Fn::GetAtt:
- EcsAssignPrivateIpAddresses
- PrivateIpAddresses
EIP:
Value:
Fn::GetAtt:
- Eip
- EipAddress
InstanceId:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstance
- InstanceIds
PrimaryPrivateIPAddress:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstance
- PrivateIps
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VSwitchZoneId
- IpAddressCount
Label:
default:
en: VPC
zh-cn: 专有网络
- Parameters:
- EcsInstanceType
- EcsImageId
- EcsSystemDiskCategory
- EcsSystemDiskSize
- EcsPassword
Label:
default:
en: ECS
zh-cn: 云服务器
TemplateTags:
- acs:example:网络:创建绑定了多个私网地址的ECS
ALIYUN::ROS::Designer:
02f39cf2-0e28-4e3c-8a49-223aebfc38b3:
source:
id: e53e0396-80f0-4462-95a5-a8af705b936e
target:
id: acc4c898-a27c-426a-be34-f40ece62b47d
z: 1
06bcbaca-7349-4bd5-96cc-b17756bf9cd3:
source:
id: 3e443b09-2a46-47d4-aaaf-3eb419e959ee
target:
id: aaf6f751-deac-4c47-a366-88cab6fc431c
z: 1
13b8c8c2-d5a5-4f80-9d21-1a78d8911c86:
position:
x: 353
y: 345
size:
height: 60
width: 60
z: 1
3e443b09-2a46-47d4-aaaf-3eb419e959ee:
position:
x: 600
y: 115
size:
height: 60
width: 60
z: 0
6515e962-974b-481d-a6da-e3c82ecc97ed:
position:
x: 357
y: -6
size:
height: 60
width: 60
z: 0
79c4a2e1-613d-4daa-b356-67a59725e5f2:
source:
id: e53e0396-80f0-4462-95a5-a8af705b936e
target:
id: aaf6f751-deac-4c47-a366-88cab6fc431c
z: 1
9f80bfea-7ec9-433c-9591-545fea014a7b:
source:
id: cba01acc-c736-4252-bb81-f228f9a55a69
target:
id: 13b8c8c2-d5a5-4f80-9d21-1a78d8911c86
z: 1
a32597ff-9661-41c7-acbe-41eb9a7bc410:
source:
id: aaf6f751-deac-4c47-a366-88cab6fc431c
target:
id: 13b8c8c2-d5a5-4f80-9d21-1a78d8911c86
z: 1
aab79dcb-b4b2-4251-801d-6fba4f3f6d26:
source:
id: 6515e962-974b-481d-a6da-e3c82ecc97ed
target:
id: aaf6f751-deac-4c47-a366-88cab6fc431c
z: 1
aaf6f751-deac-4c47-a366-88cab6fc431c:
position:
x: 421
y: 166
size:
height: 60
width: 60
z: 2
acc4c898-a27c-426a-be34-f40ece62b47d:
position:
x: 599
y: 340
size:
height: 60
width: 60
z: 0
bf76b814-edf4-4cb9-a6d7-2adacbc72337:
embeds:
- 13b8c8c2-d5a5-4f80-9d21-1a78d8911c86
- dcd718f2-7ab6-401e-b622-25df42d5d461
position:
x: 246
y: 60
size:
height: 390
width: 287.0537109375
z: 0
cba01acc-c736-4252-bb81-f228f9a55a69:
position:
x: 290
y: 166
size:
height: 60
width: 60
z: 2
d5f757fa-f13c-4739-a92d-2b79895879fe:
source:
id: cba01acc-c736-4252-bb81-f228f9a55a69
target:
id: 6515e962-974b-481d-a6da-e3c82ecc97ed
z: 1
dcd718f2-7ab6-401e-b622-25df42d5d461:
embeds:
- cba01acc-c736-4252-bb81-f228f9a55a69
- aaf6f751-deac-4c47-a366-88cab6fc431c
position:
x: 269
y: 81
size:
height: 230
width: 240
z: 1
e53e0396-80f0-4462-95a5-a8af705b936e:
position:
x: 599
y: 226
size:
height: 60
width: 60
z: 0