-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathaccelerate-static-website.yml
240 lines (239 loc) · 6.09 KB
/
accelerate-static-website.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建OSS存储桶、CDN加速域名,配置跨域访问与图片优化,实现网站静态资源全球加速。
en: Create OSS buckets, CDN acceleration domains, configure cross-origin resource
sharing (CORS) for access and image optimization, thereby realizing global acceleration
of website static resources.
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: 加速域名是指接入CDN,用于加速源站的域名。请填写您账号下的域名。仅支持二级域名,例如 prefix.example.com。
en: Accelerated domain name refers to the domain name of the access CDN used to accelerate the source site. Please fill in the domain name under your account.
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>
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 6
Prefix: image-example-
CharacterClasses:
- Class: lowercase
min: 1
Resources:
OssBucket:
Type: ALIYUN::OSS::Bucket
DependsOn: AutoEnableOSS
Properties:
BucketName:
Ref: BucketName
DeletionForce: true
AccessControl: public-read
AutoEnableCDN:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: CDN
AutoEnableOSS:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: OSS
Domain:
Type: ALIYUN::CDN::Domain
Properties:
Sources:
Fn::Sub:
- '[{"content":"${content}", "type":"oss", "priority":"20", "port":80, "weight":"10"}]'
- content:
Fn::GetAtt:
- OssBucket
- DomainName
CdnType: web
Scope:
Ref: Scope
DomainName:
Ref: DomainName
DependsOn: AutoEnableCDN
DomainRecord:
Type: ALIYUN::DNS::DomainRecord
Properties:
Type: CNAME
RR:
Fn::Select:
- 0
- Fn::Split:
- .
- Ref: DomainName
Value:
Fn::GetAtt:
- Domain
- Cname
DomainName:
Fn::Join:
- .
- Fn::Select:
- '1:'
- Fn::Split:
- .
- Ref: DomainName
DependsOn: Domain
DomainConfig:
Type: ALIYUN::CDN::DomainConfig
Properties:
FunctionList:
- FunctionArgs:
- ArgName: file_type
ArgValue: jpg,png,jpeg
- ArgName: weight
ArgValue: '99'
- ArgName: ttl
ArgValue: '2592000'
FunctionName: filetype_based_ttl_set
- FunctionArgs:
- ArgName: private_oss_auth
ArgValue: 'on'
- ArgName: perm_private_oss_tbl
ArgValue: ''
FunctionName: l2_oss_key
- FunctionArgs:
- ArgName: filetype
ArgValue: jpeg
- ArgName: webp
ArgValue: 'off'
- ArgName: orient
ArgValue: 'off'
- ArgName: slim
ArgValue: 90
- ArgName: enable
ArgValue: 'on'
FunctionName: image_transform
DomainNames:
Ref: Domain
DependsOn: DomainRecord
Outputs:
Cname:
Description: CNAME
Value:
Fn::GetAtt:
- Domain
- Cname
DomainName:
Description: DomainName
Value:
Ref: Domain
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- Scope
- DomainName
- BucketName
TemplateTags:
- acs:technical-solution:cdn-and-video-cloud:网站静态资源跨地域访问加速-tech_solu_108
ALIYUN::ROS::Composer:
e153ffe4:
Rect:
- 535
- 398
- 40
- 324
- 1
- 0
ResT: Composer::ROSParameter::AlibabaCloud
d8f35259:
Parent: e153ffe4
Rect:
- 445
- 310
- 86
- 371
- 2
- 0
ResT: Composer::ROSParameter::Region
85f0acdd:
Res:
- OssBucket
Parent: d8f35259
Rect:
- 40
- 40
- 412
- 447
- 3
- 0
533ba038:
Res:
- AutoEnableCDN
Parent: d8f35259
Rect:
- 40
- 40
- 221
- 558
- 3
- 0
8e7e879c:
Res:
- AutoEnableOSS
Parent: d8f35259
Rect:
- 40
- 40
- 356
- 558
- 3
- 0
d9b56ef5:
Res:
- Domain
Parent: d8f35259
Rect:
- 40
- 40
- 287
- 447
- 3
- 0
c0288195:
Res:
- DomainConfig
Parent: d8f35259
Rect:
- 40
- 40
- 165
- 447
- 3
- 0
739c13ba:
Parent: d8f35259
Edge:
- d9b56ef5
- 85f0acdd
Line: 0:0:0:gray:0
f987ef44:
Parent: d8f35259
Edge:
- c0288195
- d9b56ef5
Line: 0:0:0:gray:0