forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
internet-industry-high-elastic-system-construction.yml
1612 lines (1602 loc) · 49.9 KB
/
internet-industry-high-elastic-system-construction.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
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 构建互联网高可用系统,整合ESS、POLARDB、REDIS、SLB实现应用与数据库弹性伸缩,及跨可用区容灾能力。
en: Build an Internet high-availability system and integrate ESS, POLARDB, REDIS, and SLB to achieve elastic scaling of applications and databases, as well as cross-availability zone disaster recovery capabilities.
Conditions:
IsCreateDBNodes:
Fn::Not:
Fn::Equals:
- Ref: DBNodesAmount
- 0
IsCreateDnsDomainRecord:
Fn::Not:
Fn::Equals:
- Ref: DnsDomainName
- default
Parameters:
DnsDomainName:
Type: String
Label:
en: Domain Name
zh-cn: 域名
Description:
en: Domain Name.The default value default is not parsed.
zh-cn: 域名。默认值default时不做解析。
Default: default
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
VSwithZone1:
Type: String
Label:
en: VSwitch 1 Availability Zone
zh-cn: 交换机1可用区
Description:
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please
confirm that the Availability Zone supports the specification of creating
SLB、REDIS and ECS resources</font></b>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建SLB、REDIS及ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitchCidrBlock1:
Type: String
Label:
en: VSwitch 1 CIDR Block
zh-cn: 交换机1网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.3.0/24
VSwithZone2:
Type: String
Label:
en: VSwitch 2 Availability Zone
zh-cn: 交换机2可用区
Description:
en: Availability Zone ID,<font color='red'><b>please select a different availability
zone than Switch 1</b></font><br><b>note:<font color='red'>PolarDB Resource
availability zone Less </font><br><font color='blue'>before selecting, please
confirm that the Availability Zone supports the specification of creating
POLARDB and ECS resources</font></b>
zh-cn: 可用区ID,<font color='red'><b>请选择与交换机1不同的可用区</b></font><br><b>注: <font color='red'>POLARDB资源可用区较少</font><br><font
color='blue'>选择前请确认该可用区是否支持创建POLARDB及ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitchCidrBlock2:
Type: String
Label:
en: VSwitch 2 CIDR Block
zh-cn: 交换机2网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.4.0/24
EipBandwidth:
Type: Number
Label:
en: EIP Bandwidth
zh-cn: 弹性IP带宽峰值
Description:
en: 'Value range: [0, 1000], Unit: Mbps.'
zh-cn: 取值范围:[0, 1000],单位:Mbps。
Default: 10
MinValue: 1
MaxValue: 1000
LoadBalancerSpec:
Type: String
Label:
en: Specifications
zh-cn: 规格
Description:
en: Instance specifications,</br>see detail:</b><a href='https://www.alibabacloud.com/help/en/doc-detail/85939.html'
target='_blank'><b><font color='blue'>Performance support type</b></font></a>
zh-cn: 实例规格,</br>详见:</b><a href='https://help.aliyun.com/document_detail/85939.html'
target='_blank'><b><font color='blue'>性能保障型</b></font></a>
Default: slb.s2.medium
ImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: 'Server Instance Image ID,</br>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: 服务器镜像,</br>详见:<b><a href='https://help.aliyun.com/document_detail/112977.html'
target='_blank'><font color='blue'>查找镜像</font></a></b>
Default: centos_7
VSwitch1InstanceType:
Type: String
Label:
en: Availability Zone 1 Instance Type
zh-cn: 可用区1实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch 1 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 1可用区下可使用的规格;<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: VSwithZone1
VSwitch2InstanceType:
Type: String
Label:
en: Availability Zone 2 Instance Type
zh-cn: 可用区2实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch 2 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 2可用区下可使用的规格;<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: VSwithZone2
DiskCategory:
Type: String
Label:
en: 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_efficiency
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud
- cloud_essd
- ephemeral_ssd
DiskSize:
Type: Number
Label:
en: Instance Disk Space
zh-cn: 实例数据盘空间
Description:
en: 'Instance disk size, range of values: 20-500, units: GB.'
zh-cn: 实例数据盘大小,单位为GiB,取值范围:20~500。
Default: 100
MinValue: 20
MaxValue: 500
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
CustomImageName:
Type: String
Label:
en: Image Name
zh-cn: 镜像名称
Description:
en: Length is [2,64].Must begin with size letters or Chinese characters, including
letters, characters, Numbers, underscores (_) and hyphens (-), not http://
and https://.
zh-cn: 长度为 [2,64]。必须以大小字母或中文开头,可包含字母、汉字、数字、下划线(_)和连字符(-),不能以 http:// 和 https://
开头。
Default: wp_mirro
RedisClass:
Type: String
Label:
en: Specifications
zh-cn: 规格
Description:
en: 'Fill in instance specifications based on database type and availability
zone support;<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/26350.html''
target=''_blank''><b><font color=''blue''>Specification inquiry</font></b></a>'
zh-cn: 根据数据库类型和可用区支持的情况填写实例规格;<br>请参见详细信息:<a href='https://help.aliyun.com/document_detail/26350.html'
target='_blank'><b><font color='blue'>规格查询</font></b></a>
Default: redis.master.stand.default
EvictionPolicy:
Type: String
Label:
en: Eviction Policy
zh-cn: 数据逐出策略
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[noeviction: <font
color=''green''>Without ejecting any data, writes to new data get an error
message</font>]<br>[allkeys-lru: <font color=''green''>The LRU algorithm is
used to eject the original data</font>]<br>[volatile-lru: <font color=''green''>The
LRU algorithm is used to eject the original data, but only the data whose
expiration time is set</font>]<br>[allkeys-random: <font color=''green''>Randomly
eject the original data</font>]<br>[volatile-random: <font color=''green''>Randomly
eject the original data, but only the data with the expiration date set</font>]<br>[volatile-ttl:
<font color=''green''>Only data whose expiration date is set is evicted, and
the eviction is done in the order of TTL from small to large</font>]<br><font
color=''blue''></a>'
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[noeviction: <font color=''green''>不逐出任何数据,新数据的写入会得到一个错误信息</font>]<br>[allkeys-lru:
<font color=''green''>按照 LRU 算法逐出原有数据</font>]<br>[volatile-lru: <font color=''green''>按照
LRU 算法逐出原有数据,但仅逐出设置了过期时间的数据</font>]<br>[allkeys-random: <font color=''green''>随机逐出原有数据</font>]<br>[volatile-random:
<font color=''green''>随机逐出原有数据,但仅逐出设置了过期时间的数据</font>]<br>[volatile-ttl: <font
color=''green''>仅逐出设置了过期时间的数据,并且是按照 TTL 由小到大的顺序进行逐出</font>]<br><font color=''blue''></a>'
Default: noeviction
AllowedValues:
- noeviction
- allkeys-lru
- volatile-lru
- allkeys-random
- volatile-random
- volatile-ttl
RedisPassword:
Type: String
Label:
en: Instance password
zh-cn: 实例密码
Description:
en: 'The password can be 8 to 32 characters in length and must contain three
of the following conditions: uppercase letters, lowercase letters, numbers,
and special characters ( !@#$%^&*()_+-= ).'
zh-cn: 密码长度可以是8到32个字符,并且必须包含以下三种情况:大写字母、小写字母、数字和特殊字符(!@#$%^&*()_+-=)。
ConstraintDescription:
en: 'The password can be 8 to 32 characters in length and must contain three
of the following conditions: uppercase letters, lowercase letters, numbers,
and special characters ( !@#$%^&*()_+-= ).'
zh-cn: 密码长度可以是8到32个字符,并且必须包含以下三种情况:大写字母、小写字母、数字和特殊字符(!@#$%^&*()_+-=)。
MinLength: 8
MaxLength: 32
NoEcho: true
DBNodesAmount:
Type: Number
Label:
en: Nodes Amount
zh-cn: 集群添加节点数
Description:
en: 'Value range: [0, 14].'
zh-cn: '取值范围: [0, 14]。'
Default: 0
MinValue: 0
MaxValue: 14
DBClusterTypeAndVersion:
Type: String
Label:
en: Type And Version
zh-cn: 类型与版本号
Description:
en: Database type and version number.
zh-cn: 数据库类型与版本号。
Default: MySQL-5.6
AllowedValues:
- MySQL-5.6
- MySQL-8.0
- Oracle-11
- PostgreSQL-11
DBNodeClass:
Type: String
Label:
en: Node Class
zh-cn: 规格
Description:
en: See details:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/68498.html'
target='_blank'><font color='blue'>Specification and pricing</font></a></b>
zh-cn: 详见:<b><a href='https://help.aliyun.com/document_detail/68498.html' target='_blank'><font
color='blue'>规格与定价</font></a></b>
Default: polar.mysql.x4.medium
DBInstanceCharacterSetName:
Type: String
Label:
en: Character Set
zh-cn: 字符集
Description:
en: 'For more information on values, </br>see detail: <b><a href=''https://www.alibabacloud.com/help/en/doc-detail/99716.html''
target=''_blank''><font color=''blue''>Character Set Table</font></a></b>'
zh-cn: 取值详情,</br>详见:<b><a href='https://help.aliyun.com/document_detail/99716.html'
target='_blank'><font color='blue'>字符集表</font></a></b>
Default: utf8
DBName:
Type: String
Label:
en: Database Name
zh-cn: 数据库名称
Description:
en: Maximum 64 characters.Made up of lowercase letters, Numbers, middle lines,
and underscores. Must begin with a lowercase letter and end with a letter
or number.
zh-cn: 最长64个字符。由小写字母、数字、中划线、下划线组成,必须以小写英文字母开头,以字母或数字结尾。
Default: wordpress
PolarAccountName:
Type: String
Label:
en: Database Account
zh-cn: 数据库帐号
Description:
en: Maximum 16 characters,Consists of a lowercase letter, a number, an underscore,
a letter beginning, a letter or a number ending.
zh-cn: 最长16个字符, 由小写字母,数字、下划线组成、字母开头,字母或数字结尾。
Default: wp_admin
DBAccountPassword:
Type: String
Label:
en: Account Password
zh-cn: 数据库帐号密码
Description:
en: 'Length 8-32 characters, can contain size letters, Numbers and special symbols
(including: !@#$%^&*-+=_).'
zh-cn: 长度8-32个字符,可包含大小字母、数字及特殊符号(包含:!@#$%^&*-+=_)。
ConstraintDescription:
en: '8-32 characters, can contain size letters, Numbers and special symbols
(including: !@#$%^&*-+=_).'
zh-cn: 8-32个字符,可包含大小字母、数字及特殊符号(包含:!@#$%^&*-+=_)。
MinLength: '8'
MaxLength: '32'
NoEcho: true
MinSize:
Type: Number
Label:
en: Min Amount
zh-cn: 实例数量最小值
Description:
en: 'Minimum number of ECS instances within a scaling group, Value range: [0,
100].'
zh-cn: 伸缩组内ECS实例的最小数量,取值范围:[0, 100]。
Default: 1
MaxSize:
Type: Number
Label:
en: Max Amount
zh-cn: 实例数量最大值
Description:
en: 'Maximum number of ECS instances within a scaling group, Value range: [0,
100].'
zh-cn: 伸缩组内ECS实例的最大数量,取值范围:[0, 100]。
Default: 5
DefaultCooldown:
Type: Number
Label:
en: Cooling Time
zh-cn: 冷却时间
Description:
en: 'Value range: [0,86400], default is 300 seconds.'
zh-cn: 取值范围:[0,86400],默认300秒。
Default: '300'
AdjustmentType:
Type: String
Label:
en: Adjustment Type
zh-cn: 伸缩规则调整方式
Description:
en: <font color='blue'><b>Optional values:</b></font><br>[QuantityChangeInCapacity:<font
color='green'>Increases or decreases a specified number of ECS instances</font>]<br>[PercentChangeInCapacity:<font
color='green'>Increases or decreases ECS instances by a specified percentage</font>]<br>[TotalCapacity:<font
color='green'>Adjusts the number of ECS instances of the current scaling group
to the specified number</font>]<br><font color='blue'></a>
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[QuantityChangeInCapacity:<font
color=''green''>增加或减少指定数量的ECS实例</font>]<br>[PercentChangeInCapacity:<font
color=''green''>增加或减少指定比例的ECS实例</font>]<br>[TotalCapacity:<font color=''green''>将当前伸缩组的ECS实例数量调整到指定数量</font>]<br><font
color=''blue''></a>'
Default: TotalCapacity
AllowedValues:
- QuantityChangeInCapacity
- PercentChangeInCapacity
- TotalCapacity
AdjustmentValue:
Type: Number
Label:
en: Adjustment Value
zh-cn: 伸缩规则调整值
Description:
en: Under no circumstances should the number of ECS instances adjusted in a
single run exceed 500.
zh-cn: 任何情况下,单次调整的ECS实例台数都不能超过500。
Default: 1
RemovalPolicys:
Type: CommaDelimitedList
Label:
en: Remove Policy
zh-cn: 移出ECS实例的策略
Description:
en: <font color='blue'><b>Optional values:</b></font><br>[OldestInstance:<font
color='green'>take the earliest ECS instance to join the flex group</font>]<br>[NewestInstance:<font
color='green'>take the latest ECS instance that has joined the flex group</font>]<br>[OldestScalingConfiguration:<font
color='green'>take the instance that was created by the earliest scaling configuration</font>]<br><font
color='blue'></a>
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[OldestInstance:<font color=''green''>取最早加入伸缩组的
ECS 实例</font>]<br>[NewestInstance:<font color=''green''>取最新加入伸缩组的 ECS 实例</font>]<br>[OldestScalingConfiguration:<font
color=''green''>取最早伸缩配置创建的实例</font>]<br><font color=''blue''></a>'
Default: OldestScalingConfiguration
AllowedValues:
- OldestScalingConfiguration
- OldestInstance
- NewestInstance
DBClusterAccountPrivilege:
Type: String
Label:
en: Account Privilege
zh-cn: 账号权限
Description:
en: '<font color=''blue''><b>Optional values: </b></font><br>[ReadWrite:<font
color=''green''>read-write</font>]<br>[ReadOnly:<font color=''green''>read
only</font>]<br>[DMLOnly:<font color=''green''>only allow DML</font>]<br>[DDLOnly:<font
color=''green''>only allow DDL</font>]<br><font color=''blue''></a>'
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[ReadWrite:<font color=''green''>读写</font>]<br>[ReadOnly:<font
color=''green''>只读</font>]<br>[DMLOnly:<font color=''green''>只允许DML</font>]<br>[DDLOnly:<font
color=''green''>只允许DDL</font>]<br><font color=''blue''></a>'
Default: ReadWrite
AllowedValues:
- ReadWrite
- ReadOnly
- DMLOnly
- DDLOnly
MultiAZ:
Type: String
Label:
en: Multi Availability Zone
zh-cn: 该数据库实例是否支持多可用区
Description:
en: Whether the database instance supports Multi Availability Zone.
zh-cn: 指定该数据库实例是否支持多可用区。
Default: 'True'
AllowedValues:
- 'True'
- 'False'
Resources:
VpcEip2:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth:
Ref: EipBandwidth
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: 1ab0e4f4-791e-4d35-8863-3d87823281a4
DnsDomainRecord:
Type: ALIYUN::DNS::DomainRecord
Condition: IsCreateDnsDomainRecord
Properties:
DomainName:
Ref: DnsDomainName
RR: '@'
TTL: 600
Type: A
Value:
Fn::GetAtt:
- VpcEip2
- EipAddress
DependsOn:
- VpcEip2
Metadata:
ALIYUN::ROS::Designer:
id: 38771622-24a2-4050-8c20-89034855e204
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: e3f5d2a9-358c-4782-b52a-9123122107df
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupEgress:
- DestCidrIp: 0.0.0.0/0
IpProtocol: all
NicType: internet
PortRange: -1/-1
Priority: 1
- DestCidrIp: 0.0.0.0/0
IpProtocol: all
NicType: intranet
PortRange: -1/-1
Priority: 1
SecurityGroupIngress:
- IpProtocol: all
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: all
NicType: intranet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Tags:
- Key: best_practice
Value: '023'
Metadata:
ALIYUN::ROS::Designer:
id: 79644e70-f678-46d3-8df3-0a6ec110bac3
EcsVSwitch2:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwithZone2
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock2
VSwitchName:
Fn::Join:
- '-'
- - VSwitch2
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 72573143-a782-4886-841d-08944770d25d
EcsInstance:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch2
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageId
AllocatePublicIP: false
DiskMappings:
- Category:
Ref: DiskCategory
Size:
Ref: DiskSize
InstanceChargeType: PostPaid
InstanceType:
Ref: VSwitch2InstanceType
IoOptimized: optimized
Password:
Ref: Password
SystemDiskCategory:
Ref: DiskCategory
Tags:
- Key: best_practice
Value: '023'
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- WaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - '#!/bin/sh'
- " \n"
- DatabaseUser=
- Ref: PolarAccountName
- " \n"
- DatabasePwd=
- Ref: DBAccountPassword
- " \n"
- DatabaseName=
- Ref: DBName
- " \n"
- charset=
- Ref: DBInstanceCharacterSetName
- " \n"
- host=
- Fn::Join:
- .
- - Fn::GetAtt:
- PolarDBCluster
- DBClusterId
- mysql.polardb.rds.aliyuncs.com
- " \n"
- redis_host=
- Fn::GetAtt:
- RedisInstance
- ConnectionDomain
- " \n"
- redis_password=
- Ref: RedisPassword
- " \n"
- "WebRootPath='/var/www/html' \n"
- "ApacheIndex='Options Indexes FollowSymLinks' \n"
- "ApacheIndexReplace='Options FollowSymLinks' \n"
- "mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup\
\ \n"
- "wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo\
\ \n"
- "yum makecache \n"
- "yum install -y unzip zip \n"
- "yum install -y curl httpd mysql-server php56 php56-php-mysql \n"
- "#yum install -y php56-php-gd php56-php-imap php56-php-ldap php56-php-odbc\
\ php56-php-xmlrpc \n"
- "rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm \n"
- "rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm \n"
- "yum install -y php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64\
\ php56w-gd.x86_64 php56w-imap.x86_64 php56w-ldap.x86_64 php56w-mysql.x86_64\
\ php56w-pdo.x86_64 php56w-odbc.x86_64 php56w-process.x86_64 php56w-xml.x86_64\
\ php56w-xmlrpc.x86_64 \n"
- "systemctl restart httpd \n"
- "chkconfig httpd on \n"
- "i=1 \n"
- "while [ $i -le 2 ] \n"
- "do \n"
- " wget -T 10 -O latest-zh_CN.tar.gz https://cn.wordpress.org/latest-zh_CN.tar.gz\
\ \n"
- " if [ $? -eq 0 ];then \n"
- " tar -xzvf latest-zh_CN.tar.gz \n"
- " break \n"
- " else \n"
- " let i++ \n"
- " fi \n"
- "done \n"
- "if [ -d 'wordpress' ]; then \n"
- " echo \"download from wordpress success\" > /tmp/report.log \n"
- "else \n"
- " wget https://ros-template-resources.oss-cn-beijing.aliyuncs.com/WordPress/WordPress.zip\
\ \n"
- " unzip WordPress.zip \n"
- " mv WordPress-master wordpress \n"
- " echo \"download from wordpress fail, download from github.\" >> /tmp/report.log\
\ \n"
- "fi \n"
- 'sed -i "s/database_name_here/$DatabaseName/" wordpress/wp-config-sample.php
'
- 'sed -i "s/username_here/$DatabaseUser/" wordpress/wp-config-sample.php
'
- 'sed -i "s/password_here/$DatabasePwd/" wordpress/wp-config-sample.php
'
- 'sed -i "s/utf8/$charset/" wordpress/wp-config-sample.php
'
- "sed -i \"s/localhost/$host/\" wordpress/wp-config-sample.php \n"
- "sed -i \"20a\\define('WP_REDIS_PASSWORD', 'redis_password');\" wordpress/wp-config-sample.php\
\ \n"
- "sed -i \"20a\\define('WP_REDIS_DATABASE', '10');\" wordpress/wp-config-sample.php\
\ \n"
- "sed -i \"20a\\define('WP_REDIS_PORT', '6379');\" wordpress/wp-config-sample.php\
\ \n"
- "sed -i \"20a\\define('WP_REDIS_HOST', 'redis_host');\" wordpress/wp-config-sample.php\
\ \n"
- "sed -i \"20a\\/** Redis conf **/\" wordpress/wp-config-sample.php \n"
- "sed -i \"s%redis_host%$redis_host%\" wordpress/wp-config-sample.php\
\ \n"
- "sed -i \"s%redis_password%$redis_password%\" wordpress/wp-config-sample.php\
\ \n"
- "echo \"Conf redis finished\" > /tmp/report.log \n"
- "cat wordpress/wp-config-sample.php | tr -d '\r' > redis-wp-config.php\
\ \n"
- "cat redis-wp-config.php > wordpress/wp-config-sample.php \n"
- 'mv wordpress/wp-config-sample.php wordpress/wp-config.php
'
- 'cp -a wordpress/* $WebRootPath
'
- 'rm -rf wordpress*
'
- "systemctl stop httpd \n"
- 'usermod -d $WebRootPath apache &>/dev/null
'
- 'chown apache:apache -R $WebRootPath
'
- 'sed -i "s/$ApacheIndex/$ApacheIndexReplace/" /etc/httpd/conf/httpd.conf
'
- "echo \"install wordPress finished\" > /tmp/report.log \n"
- "wget -T 10 https://downloads.wordpress.org/plugin/redis-cache.1.4.1.zip\
\ \n"
- "if [ $? -eq 0 ]; then \n"
- " unzip redis-cache.1.4.1.zip \n"
- " echo \"download from redis-cache success\" > /tmp/report.log \n"
- "else \n"
- " wget https://ros-template-resources.oss-cn-beijing.aliyuncs.com/WordPress/redis-cache.zip\
\ \n"
- " unzip redis-cache.zip \n"
- " mv redis-cache-master redis-cache \n"
- " echo \"download from wordpress fail, download from github.\" >> /tmp/report.log\
\ \n"
- "fi \n"
- "cp -rf redis-cache /var/www/html/wp-content/plugins/ \n"
- "cp /var/www/html/wp-content/plugins/redis-cache/includes/object-cache.php\
\ /var/www/html/wp-content/ \n"
- "systemctl start httpd \n"
- "ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" : \\\
\"SUCCESS\\\"}\" \n"
DependsOn:
- EcsVSwitch2
- EcsVpc
Metadata:
ALIYUN::ROS::Designer:
id: 24fc994f-e5f9-45da-8b63-3146cd10382e
EcsCustomImage:
Type: ALIYUN::ECS::CustomImage
Properties:
InstanceId:
Ref: EcsInstance
ImageName:
Fn::Join:
- '-'
- - Ref: CustomImageName
- Ref: ALIYUN::StackId
Tag:
- Key: best_practice
Value: '023'
DependsOn:
- EcsInstance
Metadata:
ALIYUN::ROS::Designer:
id: f7c82b85-ce2b-460a-a4da-06780029c3ba
EcsVSwitch1:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwithZone1
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock1
VSwitchName:
Fn::Join:
- '-'
- - VSwitch1
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: aaabc4b7-3ffd-4dd3-a5f8-f3512bf0da42
SlbLoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch1
AddressType: intranet
InternetChargeType: paybytraffic
LoadBalancerName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
LoadBalancerSpec:
Ref: LoadBalancerSpec
MasterZoneId:
Ref: VSwithZone1
Tags:
- Key: best_practice
Value: '023'
Metadata:
ALIYUN::ROS::Designer:
id: 8f289135-6a30-4f82-947f-abe2fca4905e
SlbListener:
Type: ALIYUN::SLB::Listener
Properties:
BackendServerPort: 80
Bandwidth: -1
HealthCheck:
HealthyThreshold: 3
HttpCode: http_2xx,http_3xx,http_4xx,http_5xx
Interval: 2
Timeout: 5
UnhealthyThreshold: 3
ListenerPort: 80
LoadBalancerId:
Ref: SlbLoadBalancer
Protocol: http
Scheduler: wrr
DependsOn: SlbLoadBalancer
Metadata:
ALIYUN::ROS::Designer:
id: ca83d5eb-4b47-43d3-980a-6ffea232e64c
EssScalingGroup:
Type: ALIYUN::ESS::ScalingGroup
Properties:
VSwitchId:
Ref: EcsVSwitch1
DefaultCooldown:
Ref: DefaultCooldown
LoadBalancerIds:
- Ref: SlbLoadBalancer
MaxSize:
Ref: MaxSize
MinSize:
Ref: MinSize
RemovalPolicys:
Ref: RemovalPolicys
ScalingGroupName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
DependsOn:
- SlbListener
Metadata:
ALIYUN::ROS::Designer:
id: 21b3a397-41f6-4290-a30b-5914dae55997
EssScalingConfiguration:
Type: ALIYUN::ESS::ScalingConfiguration
Properties:
SecurityGroupId:
Ref: EcsSecurityGroup
InstanceId:
Ref: EcsInstance
ImageId:
Ref: EcsCustomImage
DiskMappings:
- Category:
Ref: DiskCategory
Size:
Ref: DiskSize
InstanceType:
Ref: VSwitch1InstanceType
InternetChargeType: PayByTraffic
InternetMaxBandwidthIn: 1
InternetMaxBandwidthOut: 20
ScalingConfigurationName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
ScalingGroupId:
Ref: EssScalingGroup
SystemDiskCategory:
Ref: DiskCategory
TagList:
- Key: best_practice
Value: '023'
Metadata:
ALIYUN::ROS::Designer:
id: 7858d6c7-f557-42d4-8c6d-e2342ec4316c
EssScalingRule:
Type: ALIYUN::ESS::ScalingRule
Properties:
AdjustmentType:
Ref: AdjustmentType
AdjustmentValue:
Ref: AdjustmentValue
ScalingGroupId:
Ref: EssScalingGroup
ScalingRuleName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 0bfb5a29-5db1-414d-9d95-c35769575637
EssScalingGroupEnable:
Type: ALIYUN::ESS::ScalingGroupEnable
Properties:
InstanceIds:
- Ref: EcsInstance
ScalingConfigurationId:
Ref: EssScalingConfiguration
ScalingGroupId:
Ref: EssScalingGroup
ScalingRuleAris:
- Fn::GetAtt:
- EssScalingRule
- ScalingRuleAri
ScalingRuleArisExecuteVersion: '1'
DependsOn:
- EssScalingConfiguration
- EssScalingGroup
- EssScalingRule
Metadata:
ALIYUN::ROS::Designer:
id: 935de819-bafe-4828-8f14-b6ab4ce8a8c3
PolarDBCluster:
Type: ALIYUN::POLARDB::DBCluster
Properties:
ZoneId:
Ref: VSwithZone2
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch2
ClusterNetworkType: VPC
DBClusterDescription:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
DBNodeClass:
Ref: DBNodeClass
DBType:
Fn::Select:
- '0'
- Fn::Split:
- '-'
- Ref: DBClusterTypeAndVersion
DBVersion:
Fn::Select:
- '1'
- Fn::Split:
- '-'
- Ref: DBClusterTypeAndVersion
PayType: Postpaid
Metadata:
ALIYUN::ROS::Designer:
id: 08a23171-ca11-45a1-a72d-0b84da5318ae
PolarDBNodes:
Type: ALIYUN::POLARDB::DBNodes
Condition: IsCreateDBNodes
Properties:
Amount:
Ref: DBNodesAmount
DBClusterId:
Ref: PolarDBCluster
DependsOn:
- PolarDBCluster
Metadata:
ALIYUN::ROS::Designer:
id: 253b5bec-9de8-410d-b840-0b375afa1bf4
PolarDBInstance:
Type: ALIYUN::POLARDB::DBInstance
Properties:
CharacterSetName:
Ref: DBInstanceCharacterSetName
DBClusterId:
Ref: PolarDBCluster
DBName:
Ref: DBName
DependsOn: PolarDBNodes
Metadata:
ALIYUN::ROS::Designer:
id: 9318f5a0-078f-450e-aa62-32b4a1915f9e
PolarDBAccount:
Type: ALIYUN::POLARDB::Account
Properties:
AccountName:
Ref: PolarAccountName
AccountPassword:
Ref: DBAccountPassword
AccountType: Normal
DBClusterId:
Ref: PolarDBCluster
DependsOn: PolarDBInstance
Metadata:
ALIYUN::ROS::Designer:
id: 25419514-6c95-4c10-9172-2f0f321a2d7c
PolarDBAccountPrivilege:
Type: ALIYUN::POLARDB::AccountPrivilege
Properties: