forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cdn-speeds-up-oss-access.yml
68 lines (68 loc) · 1.86 KB
/
cdn-speeds-up-oss-access.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 使用CDN添加域名并解析域名,实现加速OSS的访问。
en: Use CDN to add domain names and resolve domain names to accelerate access to
OSS.
Parameters:
DomainName:
Type: String
Label:
zh-cn: 加速域名
en: Accelerated domain name
Description:
zh-cn: 加速域名是指接入CDN,用于加速源站的域名。该示例为oss.example.com。
en: Accelerated domain name refers to the domain name of the access CDN used
to accelerate the source site. The example is oss.example.com.
Default: oss.example.com
OssDomain:
Type: String
Label:
zh-cn: 源站信息
en: Source station information
Description:
zh-cn: 需要加速的OSS域名(即之前创建的OSS Bucket对应的域名)。
en: The OSS domain name that needs to be accelerated (the domain name corresponding
to the previously created OSS Bucket).
Resources:
OpenCdnService:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: DCDN
Domain:
Type: ALIYUN::CDN::Domain
Properties:
Sources:
Fn::Sub:
- '[{"content":"${content}", "type":"oss", "priority":"20", "port":80, "weight":"10"}]'
- content:
Ref: OssDomain
CdnType: web
DomainName:
Ref: DomainName
DependsOn: OpenCdnService
DomainRecord:
Type: ALIYUN::DNS::DomainRecord
Properties:
Type: CNAME
RR: oss
Value:
Fn::GetAtt:
- Domain
- Cname
DomainName:
Ref: DomainName
Outputs:
Cname:
Description: CNAME
Value:
Fn::GetAtt:
- Domain
- Cname
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- DomainName
- OssDomain
TemplateTags:
- acs:document-help:oss:使用CDN加速OSS访问