ALIYUN::ApiGateway::CustomDomain binds a custom domain name to an API group and uploads an SSL certificate.
-
The SSL certificate must match the custom domain name.
-
Attaching an SSL certificate enables HTTPS for your APIs.
Syntax
{
"Type": "ALIYUN::ApiGateway::CustomDomain",
"Properties": {
"CertificateBody": String,
"CertificateName": String,
"GroupId": String,
"CertificatePrivateKey": String,
"DomainName": String
}
}
Properties
|
Property Name |
Type |
Required |
Update Allowed |
Description |
Constraints |
|
DomainName |
String |
Yes |
No |
The custom domain name. |
If the domain name fails to be attached, find the cause and try again. |
|
GroupId |
String |
Yes |
No |
The ID of the API group. |
None |
|
CertificateBody |
String |
No |
Yes |
The content of the certificate. |
Must be a single line. Use |
|
CertificateName |
String |
No |
Yes |
The name of the SSL certificate. |
None |
|
CertificatePrivateKey |
String |
No |
Yes |
The private key of the certificate. |
None |
Return values
Fn::GetAtt
CertificateId: The ID of the certificate.
Examples
Replace placeholder values such as DomainName with your actual values.
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
GroupId:
Type: String
Description: The API group for the operation.
CertificateBody:
Type: String
CertificatePrivateKey:
Type: String
Resources:
CustomDomain:
Type: 'ALIYUN::ApiGateway::CustomDomain'
Properties:
GroupId:
Ref: GroupId
DomainName: ****.api.domain
CertificateName: demo_cert
CertificateBody:
Ref: CertificateBody
CertificatePrivateKey:
Ref: CertificatePrivateKey
JSON format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"GroupId": {
"Type": "String",
"Description": "The API group for the operation."
},
"CertificateBody": {
"Type": "String"
},
"CertificatePrivateKey": {
"Type": "String"
}
},
"Resources": {
"CustomDomain": {
"Type": "ALIYUN::ApiGateway::CustomDomain",
"Properties": {
"GroupId": {
"Ref": "GroupId"
},
"DomainName": "****.api.domain",
"CertificateName": "demo_cert",
"CertificateBody": {
"Ref": "CertificateBody"
},
"CertificatePrivateKey": {
"Ref": "CertificatePrivateKey"
}
}
}
}
}