All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ApiGateway::CustomDomain

Last Updated:Jun 08, 2026

ALIYUN::ApiGateway::CustomDomain binds a custom domain name to an API group and uploads an SSL certificate.

Note
  • 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.

Attach a domain name to an API group.

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 \n for line breaks.

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

Note

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