forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-bind-mult-eni-and-eip.yml
426 lines (426 loc) · 17.4 KB
/
ecs-bind-mult-eni-and-eip.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
417
418
419
420
421
422
423
424
425
426
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建多网卡ECS实例,按规格自动绑定弹性网卡与公网IP,支持共享带宽及自定义配置。
en: Create multi-NIC ECS instances with automatic binding of elastic network interfaces
and public IP addresses based on specifications, supporting shared bandwidth and
custom configurations.
Parameters:
VpcId:
Type: String
Label:
en: Existing VPC Instance ID
zh-cn: 现有VPC的实例ID
Description:
en: Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud
zh-cn: 现有虚拟专有网络的实例ID,控制台-VPC-专有网络下查询
AssociationProperty: ALIYUN::ECS::VPC::VPCId
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
VSwitchId:
Type: String
Label:
en: Existing VSwitch ID
zh-cn: 网络交换机ID
Description:
en: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual
Private Cloud-VSwitches
zh-cn: 现有业务网络交换机的实例ID,控制台-VPC-专有网络-交换机下查询
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: VpcId
ZoneId: VSwitchZoneId
SecurityGroupId:
Type: String
Label:
en: Business Security Group ID
zh-cn: 业务安全组ID
Description:
en: Please search the business security group ID starting with(sg-xxx)from console-ECS-Network
& Security
zh-cn: 现有业务安全组的实例ID,控制台-ECS-网络与安全-安全组下查询
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: VpcId
EcsInstanceType:
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>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>注:可用区可能不支持通用规格<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
EniCount:
Type: Number
Label:
en: The Server Binds the ENI number.
zh-cn: 服务器绑定弹性网卡数量
Description:
en: The number of Eni that a single server needs to be bound. For details of
this number limit, please refer <br>to the elastic network card information
in the instance specification table: <b><a href='https://help.aliyun.com/document_detail/25378.html'
target='_blank'><font color='blue'>Instance specification family</font></a></b>
zh-cn: 单台服务器需要绑定的弹性网卡数量,此数量限制的详细信息请参考实例规格表中的弹性网卡信息:<b><a href='https://help.aliyun.com/document_detail/25378.html'
target='_blank'><font color='blue'>实例规格族</font></a></b>
MinValue: 1
MaxValue: 32
EcsImageId:
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>
Default: centos_7
EcsSystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'System disk space, range of values: 40-500, units: GB.'
zh-cn: 系统盘空间, 取值范围:[40, 500], 单位:GB。
Default: 40
MinValue: 40
MaxValue: 500
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>]'
Default: cloud_ssd
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud
- cloud_essd
- ephemeral_ssd
EcsPassword:
Type: String
Label:
en: Login 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
BandwidthPackageId:
Type: String
Label:
en: Shared Bandwidth Instance ID
zh-cn: 共享带宽实例ID
Description:
en: 'Share bandwidth instance ID. shared bandwidth provides the regional bandwidth
sharing and multiplexing <br>function. Multiple elastic public network IP
can be integrated into the shared bandwidth instance, which can reuse the
bandwidth in the shared bandwidth, and save the cost of public network bandwidth.This
configuration does not take effect when the number of elastic public IP numbers
is 0<br>Note: each shared bandwidth instance supports binding up to 100 EIPs.For
details, please refer to:<b><a href=''https://help.aliyun.com/document_detail/150483.html''
target=''_blank''><font color=''blue''>Restrictions on use</font></a></b>'
zh-cn: 共享带宽实例ID,共享带宽提供地域级带宽共享和复用功能,可以将多个弹性公网IP统一加入到共享带宽实例中,复用共享<br>带宽中的带宽,节省公网带宽使用成本,<b><font
color='blue'>当配置弹性公网IP个数为0时此配置无效。</font></b><br>注:每个共享带宽实例最大支持绑定100个弹性公网IP,详情请参考:<b><a
href='https://help.aliyun.com/document_detail/150483.html' target='_blank'><font
color='blue'>使用限制</font></a></b>。
Default: null
EipCount:
Type: Number
Label:
en: Single Network Card Number of EIPs
zh-cn: 单网卡弹性公网IP的个数
Description:
en: The number of elastic single network card public network IP. Elastic public
IP is not created when configured to 0,<br>Without increasing the quota, each
elastic <br>network card supports binding up to 10 elastic public network
IP addresses by default. By default, each user can only apply for 20 elastic
public network IP addresses. If you need more, please increase the quota.
For details, please refer to:<b><a href='https://help.aliyun.com/document_detail/54479.html'
target='_blank'><font color='blue'>Restrictions on use</font></a></b>
zh-cn: 单网卡弹性公网IP的个数,<b><font color='blue'>配置为0时不会创建弹性公网IP</font></b>,在不提升配额的情况下,默认每个弹性网卡最多支持绑定10个弹性公网IP,<br>默认每个用户只能申请20个弹性公网IP,详情请参考:<b><a
href='https://help.aliyun.com/document_detail/54479.html' target='_blank'><font
color='blue'>使用限制</font></a></b>
Default: 1
MinValue: 0
MaxValue: 10
Resources:
ENIStack:
Type: ALIYUN::ROS::Stack
Properties:
Parameters:
EipCount:
Ref: EipCount
PackageId:
Ref: BandwidthPackageId
SecurityGroupId:
Ref: SecurityGroupId
VSwitchId:
Ref: VSwitchId
VpcId:
Ref: VpcId
TemplateBody:
Conditions:
CreateEipConditions:
Fn::Not:
Fn::Equals:
- 0
- Ref: EipCount
Outputs:
NetworkInterfaceId:
Value:
Fn::GetAtt:
- EcsENI
- NetworkInterfaceId
StackInfo:
Value:
EIPs:
Value:
Ref: Eip
NetworkInterfaceId:
Fn::GetAtt:
- EcsENI
- NetworkInterfaceId
NetworkInterfacePrivate:
Fn::GetAtt:
- EcsENI
- PrivateIpAddress
Parameters:
EipCount:
Description:
en: The number of elastic single network card public network IP. Without
increasing the quota, each elastic <br>network card supports binding
up to 10 elastic public network IP addresses by default. By default,
each user can only apply for 20 elastic public network IP addresses.
If you need more, please increase the quota. For details, please refer
to:<b><a href='https://help.aliyun.com/document_detail/54479.html'
target='_blank'><font color='blue'>Restrictions on use</font></a></b>
zh-cn: 单网卡弹性公网IP的个数,在不提升配额的情况下,默认每个弹性网卡最多支持绑定10个弹性公网IP,默认每个用户只能申<br>请20个弹性公网IP,详情请参考:<b><a
href='https://help.aliyun.com/document_detail/54479.html' target='_blank'><font
color='blue'>使用限制</font></a></b>
Label:
en: Single Network Card Number of EIPs
zh-cn: 单网卡弹性公网IP的个数
MaxValue: 10
MinValue: 0
Type: Number
PackageId:
Default: null
Description:
en: 'Share bandwidth instance ID. shared bandwidth provides the regional
bandwidth sharing and multiplexing <br>function. Multiple elastic
public network IP can be integrated into the shared bandwidth instance,
which can reuse the bandwidth in the shared bandwidth, and save the
cost of public network bandwidth.<br>Note: each shared bandwidth instance
supports binding up to 100 EIPs.For details, please refer to:<b><a
href=''https://help.aliyun.com/document_detail/150483.html'' target=''_blank''><font
color=''blue''>Restrictions on use</font></a></b>'
zh-cn: 共享带宽实例ID,共享带宽提供地域级带宽共享和复用功能,可以将多个弹性公网IP统一加入到共享带宽实例中,复用共享<br>带宽中的带宽,节省公网带宽使用成本<br>注:每个共享带宽实例最大支持绑定100个弹性公网IP,详情请参考:<b><a
href='https://help.aliyun.com/document_detail/150483.html' target='_blank'><font
color='blue'>使用限制</font></a></b>。
Label:
en: Shared Bandwidth Instance ID
zh-cn: 共享带宽实例ID
Type: String
SecurityGroupId:
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
Description:
en: Please search the business security group ID starting with(sg-xxx)from
console-ECS-Network & Security
zh-cn: 现有业务安全组的实例ID,控制台-ECS-网络与安全-安全组下查询
Label:
en: Business Security Group ID
zh-cn: 业务安全组ID
Type: String
VSwitchId:
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
Description:
en: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual
Private Cloud-VSwitches
zh-cn: 现有业务网络交换机的实例ID,控制台-VPC-专有网络-交换机下查询
Label:
en: Existing VSwitch ID
zh-cn: 网络交换机ID
Type: String
VpcId:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Description:
en: Please search the ID starts with (vpc-xxx)from console-Virtual Private
Cloud
zh-cn: 现有虚拟专有网络的实例ID,控制台-VPC-专有网络下查询
Label:
en: Existing VPC Instance ID
zh-cn: 现有VPC的实例ID
Type: String
ROSTemplateFormatVersion: '2015-09-01'
Resources:
CommonBandwidthPackageIp:
Condition: CreateEipConditions
DependOn:
- Eip
Properties:
BandwidthPackageId:
Ref: PackageId
Eips:
Fn::MergeMapToList:
- AllocationId:
Ref: Eip
Type: ALIYUN::VPC::CommonBandwidthPackageIp
EcsENI:
Properties:
SecurityGroupId:
Ref: SecurityGroupId
VSwitchId:
Ref: VSwitchId
Type: ALIYUN::ECS::NetworkInterface
Eip:
Count:
Ref: EipCount
Properties:
InstanceChargeType: Postpaid
InternetChargeType: PayByTraffic
Type: ALIYUN::VPC::EIP
EipAssociation:
Count:
Ref: EipCount
DependsOn:
- Eip
- EcsENI
- CommonBandwidthPackageIp
Properties:
AllocationId:
Fn::Select:
- Ref: ALIYUN::Index
- Ref: Eip
InstanceId:
Ref: EcsENI
Mode: MULTI_BINDED
Type: ALIYUN::VPC::EIPAssociation
TimeoutMins: 30
Count:
Ref: EniCount
EcsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
SecurityGroupId:
Ref: SecurityGroupId
ImageId:
Ref: EcsImageId
AllocatePublicIP: false
AutoRenewPeriod: 1
InstanceChargeType: PostPaid
InstanceType:
Ref: EcsInstanceType
IoOptimized: optimized
MaxAmount: 1
Password:
Ref: EcsPassword
Period: 1
PeriodUnit: Month
SystemDiskCategory:
Ref: EcsSystemDiskCategory
SystemDiskSize:
Ref: EcsSystemDiskSize
EcsEni1Attachment:
Type: ALIYUN::ECS::NetworkInterfaceAttachment
Properties:
NetworkInterfaceId:
Fn::Select:
- Ref: ALIYUN::Index
- Fn::GetAtt:
- ENIStack
- Outputs.NetworkInterfaceId
InstanceId:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstanceGroup
- InstanceIds
DependsOn:
- ENIStack
- EcsInstanceGroup
Count:
Ref: EniCount
Outputs:
EcsInstanceId:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstanceGroup
- InstanceIds
EcsInstancePrivateIp:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstanceGroup
- PrivateIps
NetworkInterfaceId:
Value:
Fn::GetAtt:
- ENIStack
- Outputs.StackInfo
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcId
- VSwitchZoneId
- VSwitchId
- SecurityGroupId
- EcsInstanceType
- EniCount
- EcsImageId
- EcsSystemDiskSize
- EcsSystemDiskCategory
- EcsPassword
Label:
default: ECS
- Parameters:
- BandwidthPackageId
- EipCount
Label:
default: VPC
TemplateTags:
- acs:example:网络:创建一台多网卡绑定多弹性公网地址的云服务器(已有VPC)