forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
existing-vpc-anycasteip-attach-slb-bind-ecs.yml
393 lines (393 loc) · 12.9 KB
/
existing-vpc-anycasteip-attach-slb-bind-ecs.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Create Anycast EIP, bind the newly created SLB, and mount the newly created
ECS to the SLB.
zh-cn: 创建Anycast EIP,绑定新建的SLB,并将新建的ECS挂载到SLB上。
Parameters:
VPC:
Type: String
Label:
en: VPC ID
zh-cn: 专有网络VPC实例ID
Description:
en: Please search the ID starting with (vpc-xxx)from console-Virtual Private
Cloud
zh-cn: 现有虚拟专有网络的实例ID,控制台-VPC-专有网络下查询
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitch:
Type: String
Label:
en: VSwitch ID
zh-cn: 交换机实例ID
Description:
en: Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch
must be under VPC. ECS will be created under this VSwitch</font>
zh-cn: 现有交换机ID,控制台-VPC-交换机下查询,<font color='red'>交换机必须在VPC下。ECS将创建在此交换机下</font>
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
ZoneId: ${VSwitchZoneId}
SecurityGroup:
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-网络与安全-安全组下查询。<br><font color='red'>安全组必须归属在VPC下。</font>
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VPC}
VSwitchZoneId:
Type: String
Label:
en: Available Area ID
zh-cn: 可用区ID
Description:
en: Available area id, <a href='https://help.aliyun.com/document_detail/123712.html'
target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
zh-cn: 可用区ID,</font><a href='https://help.aliyun.com/document_detail/123712.html'
target='_blank'><b> 查看可用区信息</b><font color='blue'></a>。
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ECSImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: Image ID,Please use Centos7, 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, 请使用Centos7, 详见:<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
ECSDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系统盘类型
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${ECSInstanceType}
InstanceChargeType:
Type: String
Label:
en: Instance Charge Type
zh-cn: 实例的付费方式
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
ECSSysDiskSize:
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
MinValue: 40
MaxValue: 500
Count:
Type: Number
Label:
en: Count
zh-cn: 数量
Description:
en: The number of ECS to be created.
zh-cn: 需要创建的ecs的数量。
Default: 1
MinValue: 1
MaxValue: 140
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,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
Default: null
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
KeyPairName:
Type: String
Label:
en: Key Pair Name
zh-cn: 密钥对名称
Description:
en: If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If
you have filled in <font color='green'>key pair name</font>, <font color='green'>instance
password< The content of /font> will still be set in the instance, but the
password login method in the Linux system will be forbidden.<br><font color='red'>Please
enter the name of an existing key pair. If you use the instance password Login,
the key pair name does not need to be filled in</font>
zh-cn: 如果是Windows ECS实例,则忽略该参数。默认为空。<br>如果已填写<font color='green'>密钥对名称</font>,<font
color='green'>实例密码</font>的内容仍会被设置到实例中,但是Linux系统中的密码登录方式会被禁止。<br><font color='red'>请输入已有密钥对的名称。如使用实例密码登录,密钥对名称不需要填写</font>
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Default: null
LoadBalancerAddressType:
Type: String
Label:
en: Address Type
zh-cn: 地址类型
Description:
en: The address type of the load balancer. "intranet" or "internet".
zh-cn: '负载均衡器的地址类型。intranet: 内网, internet: 外网。'
Default: intranet
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
HealthCheck:
Type: Json
Label:
en: HealthCheck
zh-cn: 健康状况检查
Description:
en: The attributes set by the health check.
zh-cn: 健康状况检查设置的属性。
Default: |-
{
"Interval": 2,
"URI": "/",
"HttpCode": "http_2xx,http_3xx",
"HealthyThreshold": 3,
"Timeout": 5,
"UnhealthyThreshold": 3,
"Port": 22
}
Protocol:
Type: String
Label:
en: Protocol
zh-cn: 传输协议
Description:
en: 'The load balancer transport protocol used for routing: tcp or udp.'
zh-cn: 用于路由的负载均衡器传输协议:tcp或udp。
Default: tcp
AllowedValues:
- tcp
- udp
Name:
Type: String
Label:
en: Anycast EIP Name
zh-cn: 任播弹性公网名称
Description:
en: Anycast EIP Name,Start with upper and lower letters or Chinese, and can
contain numbers, underscores (_) or dashes (-)
zh-cn: 任播弹性公网名称,以大小字母或中文开头,可包含数字,下划线(_)或短划线(-)
Default: auto_name
AllowedPattern: '[0-9A-Za-z\_\-]+$'
Resources:
AnycastEip:
Type: ALIYUN::VPC::AnycastEIP
Properties:
InstanceChargeType: PostPaid
InternetChargeType: PayByTraffic
Name:
Ref: Name
ServiceLocation: international
ECSInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ECSImageId
AllocatePublicIP: 'false'
InstanceChargeType:
Ref: InstanceChargeType
InstanceType:
Ref: ECSInstanceType
IoOptimized: optimized
KeyPairName:
Ref: KeyPairName
MaxAmount:
Ref: Count
Password:
Ref: ECSPassword
SystemDiskCategory:
Ref: ECSDiskCategory
SystemDiskSize:
Ref: ECSSysDiskSize
SlbLoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
AddressType:
Ref: LoadBalancerAddressType
LoadBalancerName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
LoadBalancerSpec:
Ref: LoadBalancerSpec
PayType: PayOnDemand
ECSAttachmentSlb:
Type: ALIYUN::SLB::BackendServerAttachment
Properties:
BackendServerList:
Fn::GetAtt:
- ECSInstanceGroup
- InstanceIds
LoadBalancerId:
Ref: SlbLoadBalancer
AnycastEIPAssociation:
Type: ALIYUN::VPC::AnycastEIPAssociation
Properties:
AnycastId:
Ref: AnycastEip
BindInstanceId:
Ref: SlbLoadBalancer
BindInstanceRegionId:
Ref: ALIYUN::Region
BindInstanceType: SlbInstance
DependsOn:
- AnycastEip
- ECSAttachmentSlb
Listener:
Type: ALIYUN::SLB::Listener
Properties:
BackendServerPort: 80
Bandwidth: -1
HealthCheck:
Ref: HealthCheck
ListenerPort: 0
LoadBalancerId:
Ref: SlbLoadBalancer
PortRange:
- EndPort: 65535
StartPort: 1
Protocol:
Ref: Protocol
Scheduler: tch
DependsOn:
- AnycastEIPAssociation
Outputs:
AnycastId:
Description: Anycast EIP instance ID
Value:
Fn::GetAtt:
- AnycastEip
- AnycastId
IpAddress:
Description: Anycase IP address
Value:
Fn::GetAtt:
- AnycastEip
- IpAddress
Name:
Description: Anycast EIP instance name
Value:
Fn::GetAtt:
- AnycastEip
- Name
OrderId:
Description: Order ID
Value:
Fn::GetAtt:
- AnycastEip
- OrderId
SlbLoadBalancerId:
Description: The id of load balance created.
Value:
Fn::GetAtt:
- SlbLoadBalancer
- LoadBalancerId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VPC
- VSwitchZoneId
- VSwitch
- SecurityGroup
Label:
default:
en: SecurityGroup
zh-cn: 网络
- Parameters:
- ECSInstanceType
- ECSImageId
- ECSDiskCategory
- InstanceChargeType
- ECSSysDiskSize
- Count
- ECSPassword
- KeyPairName
Label:
default:
en: ECS
zh-cn: 云服务器
- Parameters:
- LoadBalancerAddressType
- LoadBalancerSpec
- HealthCheck
- Protocol
- Name
Label:
default:
en: SLB
zh-cn: 负载均衡、弹性公网
TemplateTags:
- acs:example:弹性计算:创建AnycastEIP绑定新建的SLB挂载新建ECS(已有VPC)