O recurso ALIYUN::ApiGateway::CustomDomain associa um nome de domínio personalizado a um grupo de APIs e carrega um certificado SSL.
O certificado SSL deve corresponder ao nome de domínio personalizado.
Associar um certificado SSL ativa o HTTPS para suas APIs.
Sintaxe
{
"Type": "ALIYUN::ApiGateway::CustomDomain",
"Properties": {
"CertificateBody": String,
"CertificateName": String,
"GroupId": String,
"CertificatePrivateKey": String,
"DomainName": String
}
}
Propriedades
|
Nome da propriedade |
Tipo |
Obrigatório |
Atualização permitida |
Descrição |
Restrições |
|
DomainName |
String |
Sim |
Não |
Nome do domínio personalizado. |
Se a associação do domínio falhar, identifique a causa e tente novamente. |
|
GroupId |
String |
Sim |
Não |
ID do grupo de APIs. |
Nenhuma |
|
CertificateBody |
String |
Não |
Sim |
Conteúdo do certificado. |
Deve estar em uma única linha. Use |
|
CertificateName |
String |
Não |
Sim |
Nome do certificado SSL. |
Nenhuma |
|
CertificatePrivateKey |
String |
Não |
Sim |
Chave privada do certificado. |
Nenhuma |
Valores de retorno
Fn::GetAtt
CertificateId: ID do certificado.
Exemplos
Substitua os valores de espaço reservado, como DomainName, pelos valores reais.
Formato YAML
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
Formato JSON
{
"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"
}
}
}
}
}