-
Notifications
You must be signed in to change notification settings - Fork 35
/
low-cost-link-to-business-data.yml
677 lines (674 loc) · 18.5 KB
/
low-cost-link-to-business-data.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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC环境,配置ECS实例,挂载NAS存储,分配EIP及共享带宽,优化数据迁移成本。
en: Create a VPC environment, configure ECS instances, mount NAS storage, allocate
EIP and shared bandwidth, and optimize data migration costs.
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR Block form; <br>you can use
the following IP address ranges: <br><font color=''green''>[10.0.0.0/8]</font><br><font
color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
zh-cn: 专有网络IP地址段范围,<br>您可以使用以下的IP地址段:<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
ZoneId:
Type: String
Label:
en: 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
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.0.0/24
Bandwidth:
Type: Number
Label:
en: EIP Bandwidth
zh-cn: 弹性IP带宽峰值
Description:
en: 'Value range: [0, 1000], Unit: Mbps.'
zh-cn: 取值范围:[0, 1000],单位:Mbps。
Default: 5
MinValue: 1
MaxValue: 1000
ImageId:
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
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>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
SystemDiskCategory:
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
SystemDiskSize:
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
Password:
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:
AccessGroup:
Type: ALIYUN::NAS::AccessGroup
Properties:
AccessGroupName:
Fn::Join:
- '-'
- - AccessGroup
- Ref: ALIYUN::StackId
AccessGroupType: Vpc
Metadata:
ALIYUN::ROS::Designer:
id: 018eb77c-1262-44cc-b40a-e1dc02b1f715
AccessRule:
Type: ALIYUN::NAS::AccessRule
Properties:
AccessGroupName:
Ref: AccessGroup
SourceCidrIp: 0.0.0.0/0
Metadata:
ALIYUN::ROS::Designer:
id: 91c15224-9034-49a6-8ec4-2d9b950b422c
FileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ProtocolType: NFS
StorageType: Capacity
Metadata:
ALIYUN::ROS::Designer:
id: 8581c396-aa4a-4c6f-af84-b013841151b8
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - Vpc
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 9a0295c2-fa3c-4b27-a401-99be1dab037b
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock:
Ref: VSwitchCidrBlock
VSwitchName:
Fn::Join:
- '-'
- - VSwitch
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 9c254d18-b85b-42d0-8bfe-8d057f11c42c
MountTarget:
Type: ALIYUN::NAS::MountTarget
Properties:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
AccessGroupName:
Ref: AccessGroup
FileSystemId:
Ref: FileSystem
NetworkType: Vpc
Metadata:
ALIYUN::ROS::Designer:
id: 3ebd4530-348b-43ed-9e59-e29ce434fd40
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupIngress:
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- '-'
- - SecurityGroup
- Ref: ALIYUN::StackId
Tags:
- Key: best_practice
Value: '033'
Metadata:
ALIYUN::ROS::Designer:
id: 4437bc45-0eae-4256-8e8d-dd1a4cb7306e
ECSInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ImageId
AllocatePublicIP: false
InstanceType:
Ref: EcsInstanceType
MaxAmount: 1
NetworkType: vpc
Password:
Ref: Password
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
Tags:
- Key: best_practice
Value: '033'
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- 'sudo yum -y install nfs-utils
'
- 'yum install -y telnet
'
- 'sudo sysctl -w sunrpc.tcp_slot_table_entries=128
'
- |
echo -e "
# Aliyun NAS optimization
options sunrpc tcp_slot_table_entries=128" >> /etc/modprobe.d/sunrpc.conf
- "ros-notify -d \"{\\\"Data\\\" : \\\"Success\\\", \\\"Status\\\" : \\\
\"Success\\\"}\" \n"
DependsOn:
- AccessRule
- FileSystem
- MountTarget
Metadata:
ALIYUN::ROS::Designer:
id: b7e2d75a-e0df-4acf-8104-2a16b4f367c2
Command:
Type: ALIYUN::ECS::Command
Properties:
CommandContent:
Fn::Base64Encode:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandleCommand
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- 'sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport '
- Fn::GetAtt:
- MountTarget
- MountTargetDomain
- ":/ /mnt \n"
- "ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" :\
\ \\\"SUCCESS\\\"}\" \n"
Name:
Fn::Join:
- '-'
- - SecurityGroup
- Ref: ALIYUN::StackId
Type: RunShellScript
DependsOn:
- ECSInstanceGroup
- MountTarget
Metadata:
ALIYUN::ROS::Designer:
id: a23c051a-44fa-4eb4-86ff-53de4699ed1e
CommonBandwidthPackage:
Type: ALIYUN::VPC::CommonBandwidthPackage
Properties:
Bandwidth:
Ref: Bandwidth
InternetChargeType: PayByBandwidth
Name:
Fn::Join:
- '-'
- - CommonBandwidthPackage
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: f377070d-8172-4193-a930-2ffbb72150ee
CommonBandwidthPackageIp:
Type: ALIYUN::VPC::CommonBandwidthPackageIp
Properties:
BandwidthPackageId:
Ref: CommonBandwidthPackage
Eips:
- AllocationId:
Fn::GetAtt:
- Eip
- AllocationId
Metadata:
ALIYUN::ROS::Designer:
id: 88022f09-b2cd-4be1-9c09-55cfa1185006
Eip:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth:
Ref: Bandwidth
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: 0a46a609-69db-4085-a7c2-02a8b9ad88cf
EipAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Fn::Select:
- '0'
- Fn::GetAtt:
- ECSInstanceGroup
- InstanceIds
AllocationId:
Fn::GetAtt:
- Eip
- AllocationId
Metadata:
ALIYUN::ROS::Designer:
id: e541a904-b341-41c7-a7da-969a24095b38
RosWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: bd433073-36e6-4540-b0fe-224000084033
RosWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: RosWaitConditionHandle
Timeout: 900
Metadata:
ALIYUN::ROS::Designer:
id: 45d191eb-ccb8-4c1f-bf52-e46d2d6e31ee
Invocation:
Type: ALIYUN::ECS::Invocation
Properties:
InstanceIds:
Fn::GetAtt:
- ECSInstanceGroup
- InstanceIds
CommandId:
Ref: Command
DependsOn:
- Command
- RosWaitCondition
Metadata:
ALIYUN::ROS::Designer:
id: a8c9421f-b08d-4965-83cc-8fc047d46a43
RosWaitConditionHandleCommand:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 47ed8030-dc2e-44a5-8d77-4cb33a10e2d2
RosWaitConditionCommand:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: RosWaitConditionHandleCommand
Timeout: 900
Metadata:
ALIYUN::ROS::Designer:
id: 6c7ee334-7e39-4152-985f-f18a37614d05
Outputs:
EipAddress:
Description:
en: EIP Address.
zh-cn: EIP地址。
Value:
Fn::GetAtt:
- Eip
- EipAddress
FileSystemId:
Description:
en: ID of the file system created.
zh-cn: 创建文件系统的ID。
Value:
Fn::GetAtt:
- FileSystem
- FileSystemId
MountTargetDomain:
Description:
en: Mount address command.
zh-cn: 挂载地址命令。
Value:
Fn::Join:
- ''
- - 'sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport '
- Fn::GetAtt:
- MountTarget
- MountTargetDomain
- ":/ /mnt \n"
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- ZoneId
- VSwitchCidrBlock
- Bandwidth
Label:
default: VPC
- Parameters:
- ImageId
- EcsInstanceType
- SystemDiskCategory
- SystemDiskSize
- Password
Label:
default: ECS
TemplateTags:
- acs:solution:数据迁移:利用低成本链路完成业务数据上云
ALIYUN::ROS::Designer:
018eb77c-1262-44cc-b40a-e1dc02b1f715:
position:
x: 397
y: 107
size:
height: 60
width: 60
z: 0
0a46a609-69db-4085-a7c2-02a8b9ad88cf:
position:
x: 596
y: 261
size:
height: 60
width: 60
z: 0
1690406e-277d-4ad3-9064-e1db015de2d1:
source:
id: 45d191eb-ccb8-4c1f-bf52-e46d2d6e31ee
target:
id: bd433073-36e6-4540-b0fe-224000084033
z: 1
1b66b278-8477-4f4d-bd2b-9e95f1f6abc6:
source:
id: a8c9421f-b08d-4965-83cc-8fc047d46a43
target:
id: b7e2d75a-e0df-4acf-8104-2a16b4f367c2
z: 1
1f2b5101-4566-4a03-87b5-c1c21b2a8b0f:
source:
id: 88022f09-b2cd-4be1-9c09-55cfa1185006
target:
id: f377070d-8172-4193-a930-2ffbb72150ee
z: 1
30ff13ae-8d72-4aea-93e6-a6458c6241f8:
source:
id: 91c15224-9034-49a6-8ec4-2d9b950b422c
target:
id: 018eb77c-1262-44cc-b40a-e1dc02b1f715
z: 1
3902e734-b858-48c7-8b6d-c489f3359f37:
source:
id: 3ebd4530-348b-43ed-9e59-e29ce434fd40
target:
id: 018eb77c-1262-44cc-b40a-e1dc02b1f715
z: 1
3ebd4530-348b-43ed-9e59-e29ce434fd40:
position:
x: 143
y: 107
size:
height: 60
width: 60
z: 2
3f0b39e4-3f65-4974-82b5-5b9751fd4415:
source:
id: b7e2d75a-e0df-4acf-8104-2a16b4f367c2
target:
id: 4437bc45-0eae-4256-8e8d-dd1a4cb7306e
z: 1
3f8cc959-6711-4ca2-9ef1-3d9ac2db50c1:
source:
id: e541a904-b341-41c7-a7da-969a24095b38
target:
id: 0a46a609-69db-4085-a7c2-02a8b9ad88cf
z: 1
4437bc45-0eae-4256-8e8d-dd1a4cb7306e:
position:
x: -6
y: 190
size:
height: 60
width: 60
z: 1
45d191eb-ccb8-4c1f-bf52-e46d2d6e31ee:
position:
x: 591
y: 30
size:
height: 60
width: 60
z: 0
47ed8030-dc2e-44a5-8d77-4cb33a10e2d2:
position:
x: 399
y: -54
size:
height: 60
width: 60
z: 0
6c7ee334-7e39-4152-985f-f18a37614d05:
position:
x: 593
y: -54
size:
height: 60
width: 60
z: 0
8581c396-aa4a-4c6f-af84-b013841151b8:
position:
x: 143
y: -35
size:
height: 60
width: 60
z: 0
88022f09-b2cd-4be1-9c09-55cfa1185006:
position:
x: 395
y: 339
size:
height: 60
width: 60
z: 0
8c23fd52-13a2-44a0-87bd-b3ff6ee51615:
source:
id: 3ebd4530-348b-43ed-9e59-e29ce434fd40
target:
id: 8581c396-aa4a-4c6f-af84-b013841151b8
z: 1
91c15224-9034-49a6-8ec4-2d9b950b422c:
position:
x: 593
y: 107
size:
height: 60
width: 60
z: 0
9a0295c2-fa3c-4b27-a401-99be1dab037b:
embeds:
- 9c254d18-b85b-42d0-8bfe-8d057f11c42c
- 4437bc45-0eae-4256-8e8d-dd1a4cb7306e
position:
x: -32
y: 49
size:
height: 346
width: 336
z: 0
9c254d18-b85b-42d0-8bfe-8d057f11c42c:
embeds:
- 3ebd4530-348b-43ed-9e59-e29ce434fd40
- b7e2d75a-e0df-4acf-8104-2a16b4f367c2
position:
x: 109
y: 81
size:
height: 212
width: 140
z: 1
a23c051a-44fa-4eb4-86ff-53de4699ed1e:
position:
x: 594
y: 190
size:
height: 60
width: 60
z: 0
a8c9421f-b08d-4965-83cc-8fc047d46a43:
position:
x: 395
y: 190
size:
height: 60
width: 60
z: 0
b7e2d75a-e0df-4acf-8104-2a16b4f367c2:
position:
x: 137
y: 190
size:
height: 60
width: 60
z: 2
bd433073-36e6-4540-b0fe-224000084033:
position:
x: 398
y: 30
size:
height: 60
width: 60
z: 0
de9229ce-e019-4b43-9d8e-51cd3d14ab04:
source:
id: 6c7ee334-7e39-4152-985f-f18a37614d05
target:
id: 47ed8030-dc2e-44a5-8d77-4cb33a10e2d2
z: 1
e541a904-b341-41c7-a7da-969a24095b38:
position:
x: 396
y: 261
size:
height: 60
width: 60
z: 0
f377070d-8172-4193-a930-2ffbb72150ee:
position:
x: 597
y: 339
size:
height: 60
width: 60
z: 0
fc20f812-06cc-449d-ad47-740f95f59285:
source:
id: a8c9421f-b08d-4965-83cc-8fc047d46a43
target:
id: a23c051a-44fa-4eb4-86ff-53de4699ed1e
z: 1