-
Notifications
You must be signed in to change notification settings - Fork 35
/
slb-with-2-ecs.yml
352 lines (352 loc) · 10.4 KB
/
slb-with-2-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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建SLB与2个ECS实例,配置网络与安全组,将ECS实例加入SLB后端。
en: Create an SLB (Server Load Balancer) with two ECS (Elastic Compute Service)
instances, configure the network and security groups, then add the ECS instances
to the SLB backend.
Parameters:
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
ECS_InternetChargeType:
Type: String
Label:
en: Internet Charge Type
zh-cn: 公网付费方式
Description:
en: The charge type of public internet ECS instance.
zh-cn: 访问公网计费方式。
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
InstanceType:
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.n1.large <font color='green'>2vCPU 4GiB</font>]<br></b>[ecs.n1.xlarge
<font color='green'>8vCPU 16GiB</font>]<br></b>[ecs.n1.3xlarge <font color='green'>16vCPU
32GiB</font>]
zh-cn: <font color='blue'><b>1.选择机型前请先确认当前可用区下该机型是否有货,部分机型需要提前报备</b></font><br><font
color='blue'><b>2.可选机型列表</font><br></b></font>[ecs.n1.large <font color='green'>2vCPU
4GiB</font>]<br></b>[ecs.n1.xlarge <font color='green'>8vCPU 16GiB</font>]<br></b>[ecs.n1.3xlarge
<font color='green'>16vCPU 32GiB</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ZoneId
ImageId:
Type: String
Label:
en: Image ID
zh-cn: 镜像ID
AssociationProperty: ALIYUN::ECS::Image::ImageId
AssociationPropertyMetadata:
InstanceType: ${InstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
SystemDiskCategory:
Type: String
Label:
en: System Disk Category
zh-cn: 系统盘类型
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: InstanceType
ZoneId: ZoneId
Password:
Type: String
Label:
en: Instance 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
LoadBalancerSpec:
Type: String
Label:
en: Instance Specification
zh-cn: 实例规格
Description:
en: Instance specifications, see detail:</b><a href='https://www.alibabacloud.com/help/doc-detail/85939.html'
target='_blank'><b><font color='blue'>Performance support type</b></font></a>
zh-cn: 实例规格,详见:</b><a href='https://help.aliyun.com/document_detail/85939.html'
target='_blank'><b><font color='blue'>性能保障型</b></font></a>
Default: slb.s1.small
AddressType:
Type: String
Label:
en: Address Type
zh-cn: 网络类型
Description:
en: 'Network type of LoadBalancer. Optional value: Internet: public network
access, Intranet: Intranet access.'
zh-cn: 负载均衡实例的网络类型,可选值:internet:公网访问,intranet:内网访问。
Default: internet
AllowedValues:
- internet
- intranet
SLB_InternetChargeType:
Type: String
Label:
en: Internet Charge Type
zh-cn: 公网付费方式
Description:
en: The charge type of public internet SLB instance.
zh-cn: 公网类型实例的付费方式。
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: paybytraffic
AllowedValues:
- paybybandwidth
- paybytraffic
Bandwidth:
Type: Number
Label:
en: The Peak Bandwidth
zh-cn: 带宽峰值
Description:
en: The bandwidth peak of a public network type instance of fixed bandwidth
billing.
zh-cn: 固定带宽计费方式的公网类型实例的带宽峰值。
Default: 1
MinValue: 1
MaxValue: 1000
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
Resources:
LoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
AddressType:
Ref: AddressType
Bandwidth:
Ref: Bandwidth
InternetChargeType:
Ref: SLB_InternetChargeType
LoadBalancerSpec:
Ref: LoadBalancerSpec
Metadata:
ALIYUN::ROS::Designer:
id: 95f43535-5b4b-47c8-a765-5008f2692162
Attachment:
Type: ALIYUN::SLB::BackendServerAttachment
Properties:
BackendServers:
- ServerId:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstanceGroup
- InstanceIds
Weight: 100
- ServerId:
Fn::Select:
- '1'
- Fn::GetAtt:
- EcsInstanceGroup
- InstanceIds
Weight: 100
LoadBalancerId:
Ref: LoadBalancer
Metadata:
ALIYUN::ROS::Designer:
id: 51d1f6b6-f23d-4ac5-9911-16ea7161fe20
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock: 192.168.1.0/24
securityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Ref: SecurityGroupName
Metadata:
ALIYUN::ROS::Designer:
id: c3be2476-53de-4204-8af2-acdf3623a963
EcsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Fn::GetAtt:
- securityGroup
- SecurityGroupId
ImageId:
Ref: ImageId
InstanceType:
Ref: InstanceType
InternetChargeType:
Ref: ECS_InternetChargeType
IoOptimized: optimized
MaxAmount: 2
Password:
Ref: Password
SystemDiskCategory:
Ref: SystemDiskCategory
Metadata:
ALIYUN::ROS::Designer:
id: d9ece864-0669-46f7-94da-71c60447a06d
Outputs:
BackendServerInstanceId:
Description:
en: The instance IDs of create EcsInstanceGroup
zh-cn: 创建ECS的实例IDs
Value:
Fn::GetAtt:
- EcsInstanceGroup
- InstanceIds
BackendServerPublicIp:
Description:
en: The instance public IPs of create EcsInstanceGroup.
zh-cn: 创建ECS的实例公共IPs。
Value:
Fn::GetAtt:
- EcsInstanceGroup
- PublicIps
LoadBalancerId:
Description:
en: The ID of load balance created.
zh-cn: 已创建负载平衡的ID。
Value:
Fn::GetAtt:
- LoadBalancer
- LoadBalancerId
SlbIpAddress:
Description:
en: The IP address of the load balancer.
zh-cn: 负载均衡器的IP地址。
Value:
Fn::GetAtt:
- LoadBalancer
- IpAddress
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ZoneId
- ECS_InternetChargeType
- InstanceType
- ImageId
- SystemDiskCategory
- Password
Label:
default:
en: ECS
zh-cn: 云服务器
- Parameters:
- LoadBalancerSpec
- AddressType
- SLB_InternetChargeType
- Bandwidth
Label:
default:
en: SLB
zh-cn: 负载均衡
- Parameters:
- SecurityGroupName
Label:
default:
en: SecurityGroup
zh-cn: 安全组
TemplateTags:
- acs:example:网络:创建两个ECS和SLB并将ECS创建添加到SLB后端服务器
ALIYUN::ROS::Designer:
215023b4-e6c0-441e-b71a-b6889d9c253f:
source:
id: d9ece864-0669-46f7-94da-71c60447a06d
target:
id: c3be2476-53de-4204-8af2-acdf3623a963
z: 1
238e613b-3bf7-42bf-b1b9-0e9455d5c61a:
source:
id: 51d1f6b6-f23d-4ac5-9911-16ea7161fe20
target:
id: d9ece864-0669-46f7-94da-71c60447a06d
z: 1
41d62f51-0f8b-4f4f-b81e-a4c16dae4e83:
source:
id: 51d1f6b6-f23d-4ac5-9911-16ea7161fe20
target:
id: 95f43535-5b4b-47c8-a765-5008f2692162
z: 1
51d1f6b6-f23d-4ac5-9911-16ea7161fe20:
position:
x: 108
y: 220
size:
height: 60
width: 60
z: 0
95f43535-5b4b-47c8-a765-5008f2692162:
position:
x: -36
y: 220
size:
height: 60
width: 60
z: 0
c3be2476-53de-4204-8af2-acdf3623a963:
position:
x: -39
y: 98
size:
height: 60
width: 60
z: 0
d9ece864-0669-46f7-94da-71c60447a06d:
position:
x: 108
y: 98
size:
height: 60
width: 60
z: 0