ALIYUN::CDN::Domain类型用于添加加速域名。
创建加速域名之前,请先开通CDN服务。具体操作,请参见开通CDN服务。
您的加速域名必须完成备案。
每次只能添加一个加速域名,每个用户最多支持添加50个加速域名。
源站内容如果不在阿里云平台上,需进行审核,审核工作会在下一个工作日前完成。
单个用户的调用频率为30次/秒。
语法
{
"Type": "ALIYUN::CDN::Domain",
"Properties": {
"CdnType": String,
"Sources": String,
"CheckUrl": String,
"DomainName": String,
"ResourceGroupId": String,
"Scope": String,
"TopLevelDomain": String,
"Tags": List,
"OriginServers": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
CdnType | String | 是 | 否 | 加速域名的业务类型。 | 取值:
|
DomainName | String | 是 | 否 | 需要接入CDN的加速域名。 | 支持泛域名。以半角句号(.)开头。 示例值: |
CheckUrl | String | 否 | 否 | 健康检测URL。 | 示例值: |
OriginServers | List | 否 | 否 | 源URL的列表。 | 与源相同的功能,但具有比源更高的优先级。最多支持20个。更多信息,请参见OriginServers属性。 |
ResourceGroupId | String | 否 | 是 | 资源组ID。 | 无 |
Scope | String | 否 | 否 | 加速区域。 | 取值:
|
Sources | String | 否 | 是 | 回源地址列表。 | 示例值: |
Tags | List | 否 | 是 | 标签。 | 最多支持添加20个标签。 更多信息,请参见Tags属性。 |
TopLevelDomain | String | 否 | 是 | 顶级接入域。 | 示例值: |
Tags语法
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Key | String | 是 | 否 | 标签键。 | 长度为1~128个字符,不能以 |
Value | String | 否 | 否 | 标签值。 | 长度为0~128个字符,不能以 |
OriginServers语法
"OriginServers": [
{
"Port": Integer,
"Weight": String,
"Priority": String,
"Content": String,
"Type": String
}
]
OriginServers属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Content | String | 是 | 否 | 回源地址 | 可以是IP或域名。 |
Type | String | 是 | 否 | 源站类型。 | 取值:
|
Port | Integer | 否 | 否 | 端口。 | 可以指定80、443,也可以自定义端口,默认值为80。443是HTTPS协议回源。 |
Priority | String | 否 | 否 | 源站地址对应的优先级。 | 支持20和30,默认值为20。20是主源,30是备源。 |
Weight | String | 否 | 否 | 回源权重。 | 100以内,默认值为10。 |
返回值
Fn::GetAtt
DomainName:接入CDN的域名。
Cname:CDN域名的别名。向DNS提供CNAME,以便将CDN域名映射到CNAME。
示例
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
CdnType:
AllowedValues:
- video
- download
- web
- liveStream
Description: 'The business type. Valid values: web, download, video, livestream,
and httpsdelivery. web: acceleration of images and small files download. download:
acceleration of large file downloads. video: live streaming acceleration. httpsdelivery:
SSL acceleration for HTTPS.'
Type: String
CheckUrl:
Description: The validation of the origin.
Type: String
DomainName:
Description: The CDN domain name. Wildcard domain names that start with periods
(.) are supported. For example, .example.com.
Type: String
ResourceGroupId:
Description: The ID of the resource group. If this is left blank, the system automatically
fills in the ID of the default resource group.
Type: String
Scope:
Description: 'Valid values: domestic, overseas, and global. Default value: domestic.
The setting is supported for users outside mainland China, users in mainland
China of level 3 or above.'
Type: String
Sources:
Description: The list of origin URLs.
Type: String
Tags:
Description: Tags to attach to instance. Max support 20 tags to add during create
instance. Each tag with two properties Key and Value, and Key is required.
MaxLength: 20
Type: Json
TopLevelDomain:
Description: The top-level domain, which can only be configured by users on the
whitelist.
Type: String
Resources:
Domain:
Properties:
CdnType:
Ref: CdnType
CheckUrl:
Ref: CheckUrl
DomainName:
Ref: DomainName
ResourceGroupId:
Ref: ResourceGroupId
Scope:
Ref: Scope
Sources:
Ref: Sources
Tags:
Ref: Tags
TopLevelDomain:
Ref: TopLevelDomain
Type: ALIYUN::CDN::Domain
Outputs:
Cname:
Description: The CNAME generated for the CDN domain.You must add a CNAME record
with your DNS provider to map the CDN domain name to the CNAME.
Value:
Fn::GetAtt:
- Domain
- Cname
DomainName:
Description: The CDN domain name. Wildcard domain names that start with periods
(.) are supported. For example, .example.com.
Value:
Fn::GetAtt:
- Domain
- DomainName
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"CheckUrl": {
"Type": "String",
"Description": "The validation of the origin."
},
"ResourceGroupId": {
"Type": "String",
"Description": "The ID of the resource group. If this is left blank, the system automatically fills in the ID of the default resource group."
},
"Scope": {
"Type": "String",
"Description": "Valid values: domestic, overseas, and global. Default value: domestic. The setting is supported for users outside mainland China, users in mainland China of level 3 or above."
},
"DomainName": {
"Type": "String",
"Description": "The CDN domain name. Wildcard domain names that start with periods (.) are supported. For example, .example.com."
},
"CdnType": {
"Type": "String",
"Description": "The business type. Valid values: web, download, video, livestream, and httpsdelivery. web: acceleration of images and small files download. download: acceleration of large file downloads. video: live streaming acceleration. httpsdelivery: SSL acceleration for HTTPS.",
"AllowedValues": [
"video",
"download",
"web",
"liveStream"
]
},
"TopLevelDomain": {
"Type": "String",
"Description": "The top-level domain, which can only be configured by users on the whitelist."
},
"Sources": {
"Type": "String",
"Description": "The list of origin URLs."
},
"Tags": {
"Type": "Json",
"Description": "Tags to attach to instance. Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.",
"MaxLength": 20
}
},
"Resources": {
"Domain": {
"Type": "ALIYUN::CDN::Domain",
"Properties": {
"CheckUrl": {
"Ref": "CheckUrl"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"Scope": {
"Ref": "Scope"
},
"DomainName": {
"Ref": "DomainName"
},
"CdnType": {
"Ref": "CdnType"
},
"TopLevelDomain": {
"Ref": "TopLevelDomain"
},
"Sources": {
"Ref": "Sources"
},
"Tags": {
"Ref": "Tags"
}
}
}
},
"Outputs": {
"DomainName": {
"Description": "The CDN domain name. Wildcard domain names that start with periods (.) are supported. For example, .example.com.",
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainName"
]
}
},
"Cname": {
"Description": "The CNAME generated for the CDN domain.You must add a CNAME record with your DNS provider to map the CDN domain name to the CNAME.",
"Value": {
"Fn::GetAtt": [
"Domain",
"Cname"
]
}
}
}
}