-
Notifications
You must be signed in to change notification settings - Fork 35
/
dcdn-acceleration.yml
190 lines (190 loc) · 6.81 KB
/
dcdn-acceleration.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC环境,部署ECS实例运行Nginx,配置DCDN加速,实现资源请求加速,支持自定义加速区域、实例规格及系统盘类型。
en: Create a Virtual Private Cloud (VPC) environment, deploy Elastic Compute Service
(ECS) instances running Nginx, configure Dynamic Route for CDN (DCDN) acceleration
to achieve resource request acceleration, supporting customization of acceleration
regions, instance specifications, and system disk types.
Parameters:
Scope:
Type: String
Label:
zh-cn: 加速区域
en: Acceleration area
Description:
zh-cn: 选择加速区域。加速区域为仅中国内地和全球时,服务域名必须备案。
en: Select the acceleration area. When the acceleration region is only in mainland
China and the world, the service domain name must be filed.
Default: domestic
AllowedValues:
- domestic
- overseas
- global
DomainName:
Type: String
Label:
zh-cn: 加速域名
en: Accelerated domain name
Description:
zh-cn: 需要加速的源站域名。
en: The source domain name that needs to be accelerated.
ZoneId:
Type: String
Label:
en: Primary VSwitch 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
InstanceType:
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}
Default: ecs.c5.large
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>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${InstanceType}
ZoneId: ${ZoneId}
Default: cloud_efficiency
InstancePassword:
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:
Vpc:
Type: ALIYUN::ECS::VPC
DependsOn:
- AutoEnableDCDN
Properties:
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupIngress_80:
Type: ALIYUN::ECS::SecurityGroupIngress
Properties:
SecurityGroupId:
Ref: SecurityGroup
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: intranet
PortRange: 80/80
EcsInstance:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId: centos_7_8
InstanceType:
Ref: InstanceType
SystemDiskCategory:
Ref: SystemDiskCategory
Password:
Ref: InstancePassword
IoOptimized: optimized
UserData:
Fn::Sub: |-
#!/bin/bash
# 这里配置安装脚本
yum install -y nginx
# 配置启动脚本
sudo systemctl start nginx
Domain:
Type: ALIYUN::DCDN::Domain
Properties:
Sources:
- Type: ipaddr
Content:
Fn::GetAtt:
- EcsInstance
- PublicIp
Weight: 100
Port: 80
Priority: 20
DomainName:
Ref: DomainName
Scope:
Ref: Scope
AutoEnableDCDN:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: DCDN
Outputs:
Cname:
Description: CNAME
Value:
Fn::GetAtt:
- Domain
- Cname
DomainName:
Description: Domain Name
Value:
Ref: DomainName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- DomainName
- Scope
Label:
default: DCDN
- Parameters:
- ZoneId
- InstanceType
- SystemDiskCategory
- InstancePassword
Label:
default: ECS
TemplateTags:
- acs:document-help:cdn-and-video-cloud:加速资源请求场景实践