全部產品
Search
文件中心

:ALIYUN::CDN::Domain

更新時間:Jun 25, 2024

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

加速網域名稱的業務類型。

取值:

  • web:圖片小檔案。

  • download:大檔案下載。

  • video:視音頻點播。

DomainName

String

需要接入CDN的加速網域名稱。

支援泛網域名稱。以半形句號(.)開頭。

樣本值:.example.com

CheckUrl

String

健康檢測URL。

樣本值:example.com/test.html

OriginServers

List

源URL的列表。

與源相同的功能,但具有比源更高的優先順序。最多支援20個。更多資訊,請參見OriginServers屬性

ResourceGroupId

String

資源群組ID。

Scope

String

加速地區。

取值:

  • domestic(預設值):僅中國內地。

  • overseas:全球(不包含中國內地)。

  • global:全球。

Sources

String

回源地址清單。

樣本值:[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80,"weight":"15"}]

Tags

List

標籤。

最多支援添加20個標籤。

更多資訊,請參見Tags屬性

TopLevelDomain

String

頂級接入域。

樣本值:www.yourTopLevelDomain

Tags文法

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags屬性

屬性名稱

類型

必須

允許更新

描述

約束

Key

String

標籤鍵。

長度為1~128個字元,不能以aliyunacs:開頭,不能包含http://或者https://

Value

String

標籤值。

長度為0~128個字元,不能以aliyunacs:開頭,不能包含http://或者https://

OriginServers文法

"OriginServers": [
  {
    "Port": Integer,
    "Weight": String,
    "Priority": String,
    "Content": String,
    "Type": String
  }
]  

OriginServers屬性

屬性名稱

類型

必須

允許更新

描述

約束

Content

String

回源地址

可以是IP或網域名稱。

Type

String

來源站點類型。

取值:

  • ipaddr:IP來源站點。

  • domain:標題來源站。

  • oss:OSS Bucket為來源站點。

  • fc_domain:Function Compute來源站點。

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"
    ]
   }
  }
 }
}