La ressource ALIYUN::CDN::Domain permet d'ajouter un nom de domaine accéléré.
Avant d'ajouter un nom de domaine accéléré, activez Alibaba Cloud CDN. Pour plus d'informations, consultez la rubrique Activation d'Alibaba Cloud CDN.
Le nom de domaine doit avoir fait l'objet d'un dépôt ICP (ICP filing).
Chaque appel permet d'ajouter un seul nom de domaine à CDN. Vous pouvez ajouter jusqu'à 50 noms de domaine avec un compte Alibaba Cloud.
Si le contenu du serveur d'origine n'est pas stocké sur Alibaba Cloud, il doit faire l'objet d'une révision. Celle-ci sera effectuée au plus tard à la fin du jour ouvrable suivant la soumission de votre demande.
Chaque utilisateur peut appeler cette opération 30 fois par seconde au maximum.
Syntaxe
{
"Type": "ALIYUN::CDN::Domain",
"Properties": {
"CdnType": String,
"Sources": String,
"CheckUrl": String,
"DomainName": String,
"ResourceGroupId": String,
"Scope": String,
"TopLevelDomain": String,
"Tags": List,
"OriginServers": List
}
}
Propriétés
Propriété | Type | Obligatoire | Modifiable | Description | Contrainte |
CdnType | String | Oui | Non | Le type de charge de travail du nom de domaine accéléré. | Valeurs acceptées :
|
DomainName | String | Oui | Non | Le nom de domaine accéléré à ajouter à CDN. | Les noms de domaine génériques sont pris en charge. Le nom de domaine doit commencer par un point (.). Exemple : |
CheckUrl | String | Non | Non | L'URL utilisée pour les vérifications d'état. | Exemple : |
OriginServers | List | Non | Non | Les configurations des adresses des serveurs d'origine. | La propriété OriginServers a le même effet que la propriété Sources. Toutefois, la propriété OriginServers est prioritaire sur la propriété Sources. Vous pouvez spécifier jusqu'à 20 ensembles de configurations. Pour plus d'informations, consultez les propriétés OriginServers. |
ResourceGroupId | String | Non | Oui | L'ID du groupe de ressources. | Aucune. |
Scope | String | Non | Non | La région d'accélération. | Valeurs acceptées :
|
Sources | String | Non | Oui | Les configurations des adresses des serveurs d'origine. | Exemple : |
Tags | List | Non | Oui | Les tags. | Vous pouvez ajouter jusqu'à 20 tags. Pour plus d'informations, consultez les propriétés Tags. |
TopLevelDomain | String | Non | Oui | Le nom de domaine racine. | Exemple : www.yourTopLevelDomain. |
Syntaxe des tags
"Tags": [
{
"Key": String,
"Value": String
}
]
Propriétés des tags
|
Propriété |
Type |
Obligatoire |
Modifiable |
Description |
Contrainte |
|
Key |
String |
Oui |
Non |
La clé du tag. |
La clé du tag doit comporter entre 1 et 128 caractères et ne peut pas contenir |
|
Value |
String |
Non |
Non |
La valeur du tag. |
La valeur du tag peut comporter jusqu'à 128 caractères et ne peut pas contenir |
Syntaxe d'OriginServers
"OriginServers": [
{
"Port": Integer,
"Weight": String,
"Priority": String,
"Content": String,
"Type": String
}
]
Propriétés d'OriginServers
Propriété | Type | Obligatoire | Modifiable | Description | Contrainte |
Content | String | Oui | Non | L'adresse du serveur d'origine. | Spécifiez une adresse IP ou un nom de domaine. |
Type | String | Oui | Non | Le type du serveur d'origine. | Valeurs acceptées :
|
Port | Integer | Non | Non | Le port. | Spécifiez le port 443, le port 80 ou un port personnalisé. Valeur par défaut : 80. Si vous spécifiez le port 443, CDN communique avec le serveur d'origine via HTTPS. |
Priority | String | Non | Non | La priorité du serveur d'origine. | Valeurs acceptées : 20 et 30. Valeur par défaut : 20. Une valeur de 20 indique que le serveur d'origine est primaire. Une valeur de 30 indique que le serveur d'origine est secondaire. |
Weight | String | Non | Non | Le poids du serveur d'origine. | Valeurs acceptées : une valeur numérique inférieure à 100. Valeur par défaut : 10. |
Valeurs de retour
Fn::GetAtt
DomainName : le nom de domaine accéléré ajouté à CDN.
Cname : l'alias du nom de domaine accéléré. Un nom canonique (CNAME) est fourni au système DNS pour mapper le nom de domaine accéléré au CNAME.
Arn : le nom de ressource Alibaba Cloud (ARN).
Exemples
Format 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
Format 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"
]
}
}
}
}