forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dcdn-speeds-up-data-storage-on-oss.yml
129 lines (129 loc) · 4.4 KB
/
dcdn-speeds-up-data-storage-on-oss.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
ROSTemplateFormatVersion: '2015-09-01'
Description: {}
Parameters:
SubDomainNamePrefix:
Default: null
Type: String
Description:
zh-cn: 如果您需要配置二级域名为您的OSS源站加速时,必须填写二级域名前缀,例如static。否则,请保持配置为空即可。
en: >-
If you want to configure a second-level domain name to accelerate your
OSS origin server, you must specify the second-level domain name
prefix, for example, static. Otherwise, leave the configuration empty.
Label:
zh-cn: 域名前缀
en: Sub Domain Name Prefix
BucketName:
ConstraintDescription:
zh-cn: 3 到 63 个字符,不以连字符 (-) 开头和结尾,可以包含小写字母、数字和连字符 (-)
en: >-
3 to 63 characters, not beginning and ending with a hyphen (-), can
contain lowercase letters, Numbers and hyphens (-)
Description:
zh-cn: >-
3到63个字符,不以连字符(-)开头和结尾,可以包含小写字母、数字和连字符(-);<br>备注:<font
color='blue'><b>需要保证整个网络的唯一性,已经存在的无法创建</b></font>
en: >-
3 to 63 characters, not beginning and ending with a hyphen (-), can
contain lowercase letters, Numbers and hyphens (-);<br>Note: <font
color='blue'><b>need whole network uniqueness, already existing can not
be created.</b></font>
Default: application-cdn-oss
MinLength: 3
Label:
zh-cn: 存储空间名称
en: Bucket Name
AllowedPattern: '^[a-z0-9]+[a-z0-9\-]*[a-z0-9]+$'
MaxLength: 63
Type: String
DomainName:
Placeholder: example.com
Type: String
Description:
zh-cn: >-
填写您购买的一级域名,例如example.com。如果您要绑定的Bucket在中国内地,您设置的一级域名必须进行ICP备案,否则影响您资源的创建和使用。详见:<b><a
href='https://help.aliyun.com/zh/icp-filing/getting-started/to-prepare-the-icp-record-domain-name-1?spm=a2c4g.2357270.0.i7'
target='_blank'><font color='blue'>ICP备案域名</font></a></b>
en: >-
Fill in the first-level domain name you purchased, such as example.com.
If the bucket you want to bind to is in the Chinese mainland, the
top-level domain name that you set must go through ICP filing, otherwise
the creation and use of your resources will be affected. See: <b><a
href='https://help.aliyun.com/zh/icp-filing/getting-started/to-prepare-the-icp-record-domain-name-1?spm=a2c4g.2357270.0.i7'
target='_blank'><font color='blue'>ICP Filing Domain Name</font></a></b>
Label:
zh-cn: 自定义域名
en: Domain Name
Outputs: {}
Conditions:
SubDomainName:
'Fn::Equals':
- null
- Ref: SubDomainNamePrefix
Resources:
Record:
Type: 'ALIYUN::DNS::DomainRecord'
Properties:
Type: CNAME
RR:
'Fn::If':
- SubDomainName
- Ref: SubDomainNamePrefix
- '@'
Value:
'Fn::GetAtt':
- CDNDomain
- Cname
DomainName:
Ref: DomainName
BucketDomain:
Type: 'ALIYUN::OSS::Domain'
Properties:
BucketName:
'Fn::GetAtt':
- Bucket
- Name
DomainName:
'Fn::If':
- SubDomainName
- Ref: DomainName
- 'Fn::Sub': '${SubDomainNamePrefix}.${DomainName}'
CDNDomain:
Type: 'ALIYUN::CDN::Domain'
DependsOn: BucketDomain
Properties:
CdnType: download
DomainName:
'Fn::If':
- SubDomainName
- Ref: DomainName
- 'Fn::Sub': '${SubDomainNamePrefix}.${DomainName}'
Sources:
'Fn::Sub':
- >-
[{"content":"${content}", "type":"oss", "priority":"20", "port":80,
"weight":"100"}]
- content:
'Fn::GetAtt':
- Bucket
- DomainName
Bucket:
Type: 'ALIYUN::OSS::Bucket'
Properties:
BucketName:
Ref: BucketName
DeletionForce: true
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- BucketName
Label:
default: OSS
- Parameters:
- SubDomainNamePrefix
- DomainName
Label:
default: Domain
TemplateTags:
- 'acs:technical-solution:多媒体数据存储与分发-tech_solu_46'