-
Notifications
You must be signed in to change notification settings - Fork 35
/
games-or-retail-single-db-single-service.yml
1610 lines (1603 loc) · 49.3 KB
/
games-or-retail-single-db-single-service.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: 此模板为企业提供低成本、敏捷上云方案,适用于游戏、零售等行业。通过创建VPC、ECS实例、RDS数据库、SLB负载均衡、CDN加速、OSS存储及安全组等资源,实现新项目快速部署与扩展,同时优化运营成本。
en: This template offers enterprises a cost-effective and agile cloud migration
solution, suitable for industries such as gaming, retail, and more. By provisioning
resources including Virtual Private Cloud (VPC), Elastic Compute Service (ECS)
instances, Relational Database Service (RDS), Server Load Balancer (SLB), Content
Delivery Network (CDN) acceleration, Object Storage Service (OSS), and security
groups, it enables rapid deployment and scaling of new projects while simultaneously
optimizing operational costs.
Conditions:
IsCreateCdnDomainRecord:
Fn::And:
- IsCreateDnsDomainRecord
- Fn::Not:
Fn::Equals:
- Ref: CdnDomainNamePrefix
- default
IsCreateDnsDomainRecord:
Fn::Not:
Fn::Equals:
- Ref: DnsDomainName
- default
Parameters:
DnsDomainName:
Type: String
Label:
en: Top-level Domain Name
zh-cn: 顶级域名
Description:
en: Top-level domain names,Domain name resolution and acceleration are not performed
when the default value is default;<br><b>note:<font color='blue'>Domain names
need to be registered domain names, such as“test.com”</b></font>
zh-cn: 顶级域名,默认值default时不做域名解析及加速;<br><b>注:<font color='blue'>域名需要是已经备案的域名, 如“test.com”</b></font>
Default: default
CdnDomainNamePrefix:
Type: String
Label:
en: CDN Accelerated Domain Prefix
zh-cn: 加速域名前缀
Description:
en: CDN speeds up the domain prefix of image small files
zh-cn: CDN加速图片小文件的域名前缀。
Default: default
CdnDomainScope:
Type: String
Label:
en: Accelerating Regional
zh-cn: 加速区域
Description:
en: '<font color=''blue''><b>Optional values: </b></font><br>[domestic:<font
color=''green''>Mainland China alone</font>]<br>[overseas:<font color=''green''>Global
(excluding mainland China)</font>]<br>[global:<font color=''green''>global</font>]<br><font
color=''blue''></a>'
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[domestic:<font color=''green''>仅中国大陆</font>]<br>[overseas:<font
color=''green''>全球(不包含中国大陆)</font>]<br>[global:<font color=''green''>全球</font>]<br><font
color=''blue''></a>'
Default: domestic
AllowedValues:
- domestic
- overseas
- global
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:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
VSwitch1ZoneId:
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
RDS、SLB and ECS resources</font></b>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建RDS、SLB及ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitch1CidrBlock:
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.0.0/24
VSwitch2ZoneId:
Type: String
Label:
en: VSwitch 2 Availability Zone
zh-cn: 交换机2可用区
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,And different from VSwitch 1.</font></b>
zh-cn: 可用区ID,<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格,并且与交换机1可用区不同</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitch2CidrBlock:
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.1.0/24
EipInternetChargeType:
Type: String
Label:
en: EIP Billing Method
zh-cn: 弹性公网Ip计费类型
Description:
en: 'Billing method. <br><font color=''blue''><b>Optional values:</b></font><br>[PayByBandwidth:
<font color=''green''>Pay-by-bandwidth</font>]<br>[PayByTraffic: <font color=''green''>Pay-by-data-transfer</font>]</a>'
zh-cn: '计费类型。<br><font color=''blue''><b>可选值:</b></font><br>[PayByBandwidth:
<font color=''green''>按带宽计费</font>]<br>[PayByTraffic: <font color=''green''>按流量计费</font>]</a>'
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
EcsImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: 'Server instance Image ID, see detail: <b><a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><font color=''blue''>Find the mirror</font></a></b>'
zh-cn: 服务器镜像,详见:<b><a href='https://help.aliyun.com/document_detail/112977.html'
target='_blank'><font color='blue'>查找镜像</font></a></b>
Default: centos_7_06_64
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
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
InstanceGroup1MaxAmount:
Type: Number
Label:
en: Number of Core Servers
zh-cn: 核心服务器数量
Description:
en: 'Number of created servers, value range: [1, 100].'
zh-cn: '创建服务器的数量,取值范围: [1, 100]。'
Default: 2
MinValue: 1
MaxValue: 100
InstanceGroup1InstanceType:
Type: String
Label:
en: Core Server Specifications
zh-cn: 核心服务器规格
Description:
en: 'Fill in specifications that can be used under the existing 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: VSwitch1ZoneId
InstanceGroup1SystemDiskSize:
Type: Number
Label:
en: Core Server 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
InstanceGroup2MaxAmount:
Type: Number
Label:
en: Number of Subsystem Servers
zh-cn: 子系统服务器数量
Description:
en: 'Number of created servers, value range: [1, 100].'
zh-cn: '创建服务器的数量,取值范围: [1, 100]。'
Default: 2
MinValue: 1
MaxValue: 100
InstanceGroup2InstanceType:
Type: String
Label:
en: Subsystem Server Specifications
zh-cn: 子系统服务器规格
Description:
en: 'Fill in specifications that can be used under the existing 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: VSwitch2ZoneId
InstanceGroup2SystemDiskSize:
Type: Number
Label:
en: Subsystem Server 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
InstanceGroup2DataDiskCategory:
Type: String
Label:
en: Subsystem Server 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
InstanceGroup2DiskSize:
Type: Number
Label:
en: Subsystem Server Disk Space
zh-cn: 子系统服务器数据盘空间
Description:
en: 'Data disk size, value range: [40, 500].'
zh-cn: '数据盘大小, 取值范围: [40, 500]。'
Default: 40
MinValue: 40
MaxValue: 500
DBInstanceClass:
Type: String
Label:
en: Specifications
zh-cn: 实例规格
Description:
en: 'Select the instance specification based on the type of database engine
and the available area support;<br>see detail: <a href=''https://www.alibabacloud.com/help/doc-detail/26312.htm''
target=''_blank''><b><font color=''blue''>Instance specification sheet</font></b></a>'
zh-cn: 根据数据库引擎的类型和可用的区域支持选择实例规格;<br>请参见详细信息:<a href='https://help.aliyun.com/document_detail/26312.html'
target='_blank'><b><font color='blue'>实例规格表</font></b></a>
Default: rds.mysql.s3.large
AllowedValues:
- rds.mysql.s2.large
- rds.mysql.s2.xlarge
- rds.mysql.s3.large
- rds.mysql.m1.medium
- rds.mysql.c1.large
- rds.mysql.c1.xlarge
DBInstanceStorage:
Type: Number
Label:
en: Storage Space
zh-cn: 存储空间
Description:
en: 'Database storage space, units: GB, per 5GB increment, value range: 50-1000.'
zh-cn: 数据库存储空间, 单位:GB, 每5GB进行递增,取值范围:50-1000。
Default: 50
MinValue: 50
MaxValue: 1000
DBInstanceEngineAndVersion:
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.5
- MySQL-5.6
- MySQL-5.7
- MySQL-8.0
AccountName:
Type: String
Label:
en: Database Account
zh-cn: 数据库账号
Description:
en: Database read-write account with a maximum of 16 characters, consisting
of lowercase letters, Numbers, underscores, beginning letters, and ending
letters or Numbers.
zh-cn: 数据库可读写的账号,最长16个字符, 由小写字母,数字、下划线组成、字母开头,字母或数字结尾。
Default: appdb_admin
MaxLength: 16
AccountPassword:
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个字符,可包含大小字母、数字及特殊符号(包含:!@#$%^&*-+=_)。
AssociationProperty: ALIYUN::RDS::Instance::AccountPassword
ConstraintDescription:
en: Length 8-32, must contain three(Capital letters, lowercase letters, numbers,
!@#$%^&*()_+-= Special symbol in).
zh-cn: 长度8-32,必须包含三项(大写字母、小写字母、数字、 !@#$%^&*()_+-=中的特殊符号)。
MinLength: 8
MaxLength: 32
NoEcho: true
DBInstanceDbName:
Type: String
Label:
en: Database Name
zh-cn: 数据库名称
Description:
en: The database name created by the instance, consisting of lowercase letters,
numbers, underscores, and middle lines, beginning with letters, ending with
letters or numbers, up to 64 characters.
zh-cn: 实例创建的数据库名称,由小写字母、数字、下划线、中划线组成,以字母开头,字母或数字结尾,最多64个字符。
Default: appdb
DBRootPassword:
Type: String
Label:
en: Root Password
zh-cn: root用户密码
Description:
en: Root password for MySQL application (non-rds instance)
zh-cn: MySQL应用的root用户密码(非rds实例)。
ConstraintDescription:
en: Length 8-32 characters, can contain size letters, Numbers and special symbols
(including:!@#$%^&*-+=_).
zh-cn: 长度8-32,必须包含三项(大写字母、小写字母、数字、 !@#$%^&*-+=_中的特殊符号)。
MinLength: 8
MaxLength: 32
NoEcho: true
LoadBalancerSpec:
Type: String
Label:
en: Specifications
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.s2.medium
AllowedValues:
- slb.s1.small
- slb.s2.small
- slb.s2.medium
- slb.s3.small
- slb.s3.medium
- slb.s3.large
ListenerProtocol:
Type: String
Label:
en: Listener Protocol
zh-cn: 监听负载均衡协议
Description:
en: The listening protocol used by the SLB instance front end
zh-cn: SLB实例前端使用的监听协议
Default: tcp
AllowedValues:
- tcp
- udp
- http
- https
ListenerPort:
Type: Number
Label:
en: Listening Port
zh-cn: 监听端口
Description:
en: SLB externally provided ports
zh-cn: 负载均衡对外提供的端口
Default: 80
ListenerBackendServerPort:
Type: Number
Label:
en: Backend Server Port
zh-cn: 监听后端服务器的端口
Description:
en: 'The ports used at the backend of the SLB instance. value range: 1-65535.'
zh-cn: 负载均衡实例后端使用的端口。取值范围1-65535。
Default: 80
MinValue: 1
MaxValue: 65535
BucketName:
Type: String
Label:
en: Bucket Name
zh-cn: 存储空间名称
Description:
en: The name must be 3 to 63 bytes in length, The name must start and end with
a lowercase letter or digit.The name can contain only lowercase letters, digits,
and hyphens (-).;<br><b>note:<font color='blue'>A bucket name must be globally
unique within OSS. Bucket names cannot be changed after the bucket is created.</b></font>
zh-cn: 长度为3~63个字符,必须以小写字母或数字开头和结尾,可以包含小写字母、数字和连字符(-);<br><b>注:<font color='blue'>需要全网唯一性,已经存在的不能在创建</b></font>
Default: static-demo-test-domain
BucketAccessControl:
Type: String
Label:
en: Access Control
zh-cn: 读写权限
Description:
en: '<font color=''blue''><b>Optional values: </b></font><br>[private:<font
color=''green''>All access to the file requires authentication.</font>]<br>[public-read:<font
color=''green''>File writes need to be authenticated;Files can be read anonymously.</font>]<br>[public-read-write:<font
color=''green''>Anyone (including anonymous visitors) can perform read and
write operators on the files in the bucket.</font>]'
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[private:<font color=''green''>对文件的所有访问操作需要进行身份验证。</font>]<br>[public-read:<font
color=''green''>对文件写操作需要进行身份验证;可以对文件进行匿名读。</font>]<br>[public-read-write:<font
color=''green''>所有人都可以对文件进行读写操作。</font>]'
Default: private
AllowedValues:
- private
- public-read
- public-read-write
BucketStorageClass:
Type: String
Label:
en: Storage Type
zh-cn: 存储类型
Description:
en: '<font color=''blue''><b>Optional values: </b></font><br>[Standard:<font
color=''green''>Standard storage type</font>]<br>[IA:<font color=''green''>Low
frequency access storage type</font>]<br>[Archive:<font color=''green''>Archive
storage type</font>]'
zh-cn: '<font color=''blue''><b>可选值: </b></font><br>[Standard:<font color=''green''>标准存储类型</font>]<br>[IA:<font
color=''green''>低频访问存储类型</font>]<br>[Archive:<font color=''green''>归档存储类型</font>]'
Default: Standard
AllowedValues:
- Standard
- IA
- Archive
Resources:
OssBucket:
Type: ALIYUN::OSS::Bucket
Properties:
AccessControl:
Ref: BucketAccessControl
BucketName:
Ref: BucketName
StorageClass:
Ref: BucketStorageClass
Tags:
Key: best_practice
Value: '010'
Metadata:
ALIYUN::ROS::Designer:
id: 53609f81-e0aa-4d90-824b-a7079824433a
CdnDomain:
Type: ALIYUN::CDN::Domain
Condition: IsCreateCdnDomainRecord
Properties:
CdnType: web
DomainName:
Fn::Join:
- .
- - Ref: CdnDomainNamePrefix
- Ref: DnsDomainName
Scope:
Ref: CdnDomainScope
Sources:
Fn::Join:
- ''
- - '[{"content": "'
- Fn::GetAtt:
- OssBucket
- DomainName
- '",'
- '"type": "oss",'
- '"port": 80}]'
DependsOn:
- OssBucket
Metadata:
ALIYUN::ROS::Designer:
id: 59444217-2b80-413f-8cab-4d3500729a6c
DnsDomainCnameRecord:
Type: ALIYUN::DNS::DomainRecord
Condition: IsCreateCdnDomainRecord
Properties:
DomainName:
Ref: DnsDomainName
RR:
Ref: CdnDomainNamePrefix
TTL: 600
Type: CNAME
Value:
Fn::GetAtt:
- CdnDomain
- Cname
DependsOn:
- CdnDomain
Metadata:
ALIYUN::ROS::Designer:
id: 26b9ebe4-3c57-4ee7-a179-e02c546c7f22
CdnDomainConfig:
Type: ALIYUN::CDN::DomainConfig
Condition: IsCreateCdnDomainRecord
Properties:
DomainNames:
Fn::Join:
- .
- - Ref: CdnDomainNamePrefix
- Ref: DnsDomainName
FunctionList:
- functionArgs:
- argName: oss_bucket_id
argValue:
Fn::GetAtt:
- OssBucket
- DomainName
functionName: oss_auth
- functionArgs:
- argName: private_oss_auth
argValue: 'on'
functionName: l2_oss_key
- functionArgs:
- argName: auth_type
argValue: no_auth
functionName: aliauth
DependsOn:
- DnsDomainCnameRecord
Metadata:
ALIYUN::ROS::Designer:
id: e313bc49-7e38-4154-956a-0f11049cd7e3
VpcEip:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth: 1
InternetChargeType:
Ref: EipInternetChargeType
Metadata:
ALIYUN::ROS::Designer:
id: 15f4fe4c-6b6e-49a6-a127-c0403c05b55b
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 99649900-2306-42b2-80e4-082ee1b85c08
EcsVSwitch1:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitch1ZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitch1CidrBlock
VSwitchName:
Fn::Join:
- '-'
- - VSw1
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: acc22ba6-5493-4c34-b6d0-e8f7e06c3471
SlbLoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch1
AddressType: intranet
LoadBalancerName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
LoadBalancerSpec:
Ref: LoadBalancerSpec
MasterZoneId:
Ref: VSwitch1ZoneId
PayType: PayOnDemand
Tags:
- Key: best_practice
Value: '010'
Metadata:
ALIYUN::ROS::Designer:
id: 010d8588-9ce6-4094-8c23-f67270a1db95
VpcEipBind:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: SlbLoadBalancer
AllocationId:
Ref: VpcEip
Metadata:
ALIYUN::ROS::Designer:
id: 1777e259-7223-4cc0-8b0b-7d631f36e4ea
DnsDomainARecord:
Type: ALIYUN::DNS::DomainRecord
Condition: IsCreateDnsDomainRecord
Properties:
DomainName:
Ref: DnsDomainName
RR: '@'
TTL: 600
Type: A
Value:
Fn::GetAtt:
- VpcEip
- EipAddress
DependsOn:
- VpcEipBind
Metadata:
ALIYUN::ROS::Designer:
id: a3b451f4-9e32-4272-bf58-e98fa58a6f9e
EcsSecurityGroup2:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: icmp
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- '-'
- - Regional_Security_Strategy
- Ref: ALIYUN::StackId
Tags:
- Key: best_practice
Value: '010'
Metadata:
ALIYUN::ROS::Designer:
id: 18aa100e-3495-42cc-a5fd-0c377a8317fc
EcsVSwitch2:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitch2ZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitch2CidrBlock
VSwitchName:
Fn::Join:
- '-'
- - VSw2
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 1885f195-4dde-4735-a1f2-62028ecb0f31
EcsInstanceGroup2:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch2
SecurityGroupId:
Ref: EcsSecurityGroup2
ImageId:
Ref: EcsImageId
AllocatePublicIP: true
DiskMappings:
- Category:
Ref: InstanceGroup2DataDiskCategory
Size:
Ref: InstanceGroup2DiskSize
HostName:
Fn::Join:
- ''
- - regionHZ
- -[1,3]
InstanceChargeType: PostPaid
InstanceName:
Fn::Join:
- ''
- - regionHZ
- -[1,3]
InstanceType:
Ref: InstanceGroup2InstanceType
IoOptimized: optimized
MaxAmount:
Ref: InstanceGroup2MaxAmount
Password:
Ref: EcsPassword
SystemDiskCategory:
Ref: EcsSystemDiskCategory
SystemDiskSize:
Ref: InstanceGroup2SystemDiskSize
Tags:
- Key: best_practice
Value: '010'
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandle2
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- "# set -e \n"
- DBRootPassword=
- Ref: DBRootPassword
- " \n"
- "yum -y update \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"
- "mkdir -p /opt/db \n"
- "cd /opt/db/ \n"
- "wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm\
\ \n"
- "rpm -ivh mysql-community-release-el6-5.noarch.rpm \n"
- "yum repolist all | grep mysql \n"
- "yum install mysql-community-server -y \n"
- "systemctl start mysqld \n"
- "mysqladmin -u root password $DBRootPassword \n"
- "# echo \"create database $DBWordpress character set utf8 collate utf8_bin;\"\
\ > /opt/db/test.sql \n"
- "# echo \"grant all on *.* to $UserWordpress@'localhost' identified\
\ by '$PWDWordpress';\" >> /opt/db/test.sql \n"
- "# echo \"grant all on $DBWordpress.* to $UserWordpress@'%' identified\
\ by '$PWDWordpress';\" >> /opt/db/test.sql \n"
- "# echo \"flush privileges;\" >> /opt/db/test.sql \n"
- "# mysql -u root -$DBRootPassword < /opt/db/test.sql \n"
- "# yum install -y phpmyadmin \n"
- "mkdir -p /opt/pma \n"
- "cd /opt/pma/ \n"
- "yum install -y httpd php-mysql php \n"
- "yum install -y unzip \n"
- "#if [ ! -f \"phpMyAdmin-4.8.5-all-languages.zip\" ]; then \n"
- "## unzip phpMyAdmin-4.8.5-all-languages.zip \n"
- "#else \n"
- "# wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.zip\
\ \n"
- "# unzip phpMyAdmin-4.8.5-all-languages.zip \n"
- "#fi \n"
- "#unzip phpMyAdmin-4.8.5-all-languages.zip \n"
- "yum remove -y php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64\
\ php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64\
\ php-pdo.x86_64 \n"
- "yum list installed | grep php >> /tmp/userdata1.log \n"
- "yum install -y php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64\
\ php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64php56w-mysql.x86_64\
\ php56w-pdo.x86_64 \n"
- "yum install -y phpmyadmin \n"
- "#mkdir -p /var/www/html/pma \n"
- "#cp -a phpMyAdmin-4.8.5-all-languages /var/www/html/pma \n"
- "#cd /var/www/html/pma \n"
- "#cp config.sample.inc.php config.inc.php \n"
- "export TestStr=`tr -d 'a-z0-9A-Z'</dev/urandom |head -30 |md5sum` \n"
- "#TestStr=`tr -d 'a-z0-9A-Z'</dev/urandom |head -30 |md5sum` \n"
- '#sed -i "s%$cfg[''blowfish_secret'']%//$cfg[''blowfish_secret'']%"
/etc/phpMyAdmin/config.inc.php
'
- "#sed -i 's/$cfg['blowfish_secret']/# $cfg['blowfish_secret'/' /etc/phpMyAdmin/config.inc.php\
\ \n"
- "#sed -i \"/# $cfg['blowfish_secret']/a $cfg['blowfish_secret'] = '$TestStr';\"\
\ config.inc.php \n"
- '#sed -i "s%// $cfg[''blowfish_secret''%a $cfg[''blowfish_secret'']
= ''$TestStr'';" /etc/phpMyAdmin/config.inc.php
'
- 'sed -i "s%Deny,Allow%Allow,Deny%" /etc/httpd/conf.d/phpMyAdmin.conf
'
- 'sed -i "s%Deny from All%Allow from All%" /etc/httpd/conf.d/phpMyAdmin.conf
'
- 'sed -i "/<RequireAny>/a Require all Granted" /etc/httpd/conf.d/phpMyAdmin.conf
'
- 'chkconfig httpd on
'
- "systemctl start httpd \n"
- "ss -tnl >> /tmp/userdata2.log \n"
- "ros-notify -d \"{\\\"Data\\\" : \\\"Success\\\", \\\"Status\\\" : \\\
\"Success\\\"}\" \n"
Metadata:
ALIYUN::ROS::Designer:
id: dd6d71ce-5b53-4334-99fd-a0781a2c1b1a
RdsDbInstance:
Type: ALIYUN::RDS::DBInstance
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch1
DBInstanceClass:
Ref: DBInstanceClass
DBInstanceStorage:
Ref: DBInstanceStorage
DBMappings:
- CharacterSetName: utf8
DBName:
Ref: DBInstanceDbName
Engine:
Fn::Select:
- '0'
- Fn::Split:
- '-'
- Ref: DBInstanceEngineAndVersion
EngineVersion:
Fn::Select:
- '1'
- Fn::Split:
- '-'
- Ref: DBInstanceEngineAndVersion
SecurityIPList:
Ref: VpcCidrBlock
Tags:
Key: best_practice
Value: '010'
Metadata:
ALIYUN::ROS::Designer:
id: 059bb8cf-3e7b-4484-a63b-e38b4a85df87
RdsAccount:
Type: ALIYUN::RDS::Account
Properties:
AccountName:
Ref: AccountName
AccountPassword:
Ref: AccountPassword
AccountType: Normal
DBInstanceId:
Ref: RdsDbInstance
DependsOn:
- RdsDbInstance
Metadata:
ALIYUN::ROS::Designer:
id: 5a906276-1d7c-47b8-8eef-3b1599d05833
RdsAccountPrivilege:
Type: ALIYUN::RDS::AccountPrivilege
Properties:
AccountName:
Ref: AccountName
AccountPrivilege: ReadWrite
DBInstanceId:
Ref: RdsDbInstance
DBName:
Ref: DBInstanceDbName
DependsOn:
- RdsAccount
Metadata:
ALIYUN::ROS::Designer:
id: 0e7aca8a-f939-4144-bd54-a2455049c927
RosWaitConditionHandle2:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 2b46fbe3-eed8-4b1d-a87d-020369db1509
EcsCustomImage:
Type: ALIYUN::ECS::CustomImage
Properties:
InstanceId:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstanceGroup2
- InstanceIds
ImageName:
Fn::Join:
- '-'
- - phpMyAdmin
- Ref: ALIYUN::StackId
Tag:
- Key: best_practice
Value: '010'
DependsOn:
- EcsInstanceGroup2
- RdsAccountPrivilege
- RosWaitConditionHandle2
Metadata:
ALIYUN::ROS::Designer:
id: fa982ad7-1325-4b1a-a69c-c53b604d9590
EcsSecurityGroup1:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: icmp
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Tags:
- Key: best_practice
Value: '010'
Metadata:
ALIYUN::ROS::Designer:
id: ffe531d1-90dc-4e67-960c-cf04d53eaf4f
EcsInstanceGroup1:
Type: ALIYUN::ECS::InstanceGroup