ALIYUN::APIG::Domain is used to create a domain name.
Syntax
{
"Type": "ALIYUN::APIG::Domain",
"Properties": {
"DomainName": String,
"GatewayType": String,
"Protocol": String,
"TlsMax": String,
"CertIdentifier": String,
"ResourceGroupId": String,
"TlsCipherSuitesConfig": Map,
"ForceHttps": Boolean,
"TlsMin": String,
"Http2Option": String
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
DomainName |
String |
Yes |
No |
Domain name. |
None. |
|
Protocol |
String |
Yes |
Yes |
Protocol type supported by the domain name. |
Valid values:
|
|
TlsMax |
String |
No |
Yes |
Maximum TLS protocol version. |
Maximum supported version is TLS 1.3. |
|
CertIdentifier |
String |
No |
Yes |
Certificate identifier. |
None. |
|
GatewayType |
String |
No |
No |
Gateway type. |
Valid values:
|
|
ResourceGroupId |
String |
No |
Yes |
Resource group ID. |
None. |
|
TlsCipherSuitesConfig |
Map |
No |
Yes |
Cipher suite configuration. |
For more information, see TlsCipherSuitesConfig properties. |
|
ForceHttps |
Boolean |
No |
Yes |
Force HTTPS redirect setting. |
Specifies whether to enable forced HTTPS redirect. |
|
TlsMin |
String |
No |
Yes |
Minimum TLS protocol version. |
Minimum supported version is TLS 1.0. |
|
Http2Option |
String |
No |
Yes |
HTTP/2 setting. |
Valid values:
|
TlsCipherSuitesConfig syntax
"TlsCipherSuitesConfig": {
"ConfigType": String,
"TlsCipherSuite": List
}
TlsCipherSuitesConfig properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
ConfigType |
String |
No |
Yes |
Configuration type. |
None. |
|
TlsCipherSuite |
List |
No |
Yes |
Cipher suite configuration. |
For more information, see TlsCipherSuite properties. |
TlsCipherSuite syntax
"TlsCipherSuite": [{
"Name": String
}]
TlsCipherSuite properties
|
Property |
Type |
Required |
Editable |
Description |
Constraints |
|
Name |
String |
No |
Yes |
Cipher suite name. |
None. |
Return values
Fn::GetAtt
-
DomainId: Domain name ID.
-
DomainName: Domain name.
-
Protocol: Protocol type supported by the domain name.
-
CertIdentifier: Certificate identifier.
-
Http2Option: HTTP/2 setting.
-
TlsMax: Maximum TLS protocol version.
-
TlsMin: Minimum TLS protocol version.
-
TlsCipherSuitesConfig: Cipher suite configuration.
-
ResourceGroupId: Resource group ID.
-
ForceHttps: Whether forced HTTPS redirect is enabled.
Examples
Scenario 1: Create an HTTP domain name for API Gateway
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 为云原生API网关创建一个HTTP协议的域名。
en: Create an HTTP domain for Cloud Native API Gateway.
Parameters:
DomainName:
Type: String
Label:
zh-cn: 域名
en: Domain Name
Description:
zh-cn: API网关的域名,例如api.example.com。
en: The domain name for API Gateway, e.g. api.example.com.
AllowedPattern: '^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$'
ConstraintDescription:
zh-cn: 请输入合法的域名格式,例如api.example.com。
en: Please enter a valid domain name format, e.g. api.example.com.
Resources:
Domain:
Type: ALIYUN::APIG::Domain
Properties:
DomainName:
Ref: DomainName
Protocol: HTTP
Outputs:
DomainId:
Label:
zh-cn: 域名ID
en: Domain ID
Description:
zh-cn: API网关域名的唯一标识。
en: The unique identifier of the API Gateway domain.
Value:
Fn::GetAtt:
- Domain
- DomainId
DomainName:
Label:
zh-cn: 域名
en: Domain Name
Value:
Fn::GetAtt:
- Domain
- DomainName{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "为云原生API网关创建一个HTTP协议的域名。",
"en": "Create an HTTP domain for Cloud Native API Gateway."
},
"Parameters": {
"DomainName": {
"Type": "String",
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Description": {
"zh-cn": "API网关的域名,例如api.example.com。",
"en": "The domain name for API Gateway, e.g. api.example.com."
},
"AllowedPattern": "^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$",
"ConstraintDescription": {
"zh-cn": "请输入合法的域名格式,例如api.example.com。",
"en": "Please enter a valid domain name format, e.g. api.example.com."
}
}
},
"Resources": {
"Domain": {
"Type": "ALIYUN::APIG::Domain",
"Properties": {
"DomainName": {
"Ref": "DomainName"
},
"Protocol": "HTTP"
}
}
},
"Outputs": {
"DomainId": {
"Label": {
"zh-cn": "域名ID",
"en": "Domain ID"
},
"Description": {
"zh-cn": "API网关域名的唯一标识。",
"en": "The unique identifier of the API Gateway domain."
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainId"
]
}
},
"DomainName": {
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainName"
]
}
}
}
}Scenario 2: Create an HTTPS domain name for API Gateway with SSL certificate and forced HTTPS redirect
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建HTTPS域名,配置SSL证书并启用强制HTTPS跳转。
en: Create an HTTPS domain with SSL certificate and force HTTPS redirect.
Parameters:
DomainName:
Type: String
Label:
zh-cn: 域名
en: Domain Name
Description:
zh-cn: API网关的域名,例如api.example.com。需已完成域名备案和DNS解析。
en: The domain name for API Gateway. DNS resolution and ICP filing must be completed.
AllowedPattern: '^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$'
CertIdentifier:
Type: String
Label:
zh-cn: SSL证书标识
en: SSL Certificate Identifier
Description:
zh-cn: >-
SSL证书的唯一标识,可在SSL证书服务控制台获取。
证书需与域名匹配。
en: >-
The unique identifier of the SSL certificate, obtainable from the SSL Certificates Service console.
The certificate must match the domain name.
TlsMin:
Type: String
Label:
zh-cn: TLS最低版本
en: TLS Minimum Version
Description:
zh-cn: 允许的TLS协议最低版本。建议生产环境至少使用TLS 1.2。
en: The minimum allowed TLS protocol version. TLS 1.2 or above is recommended for production.
Default: TLS 1.2
AllowedValues:
- TLS 1.0
- TLS 1.1
- TLS 1.2
- TLS 1.3
TlsMax:
Type: String
Label:
zh-cn: TLS最高版本
en: TLS Maximum Version
Description:
zh-cn: 允许的TLS协议最高版本。
en: The maximum allowed TLS protocol version.
Default: TLS 1.3
AllowedValues:
- TLS 1.0
- TLS 1.1
- TLS 1.2
- TLS 1.3
Resources:
Domain:
Type: ALIYUN::APIG::Domain
Properties:
DomainName:
Ref: DomainName
Protocol: HTTPS
CertIdentifier:
Ref: CertIdentifier
TlsMin:
Ref: TlsMin
TlsMax:
Ref: TlsMax
ForceHttps: true
Outputs:
DomainId:
Label:
zh-cn: 域名ID
en: Domain ID
Value:
Fn::GetAtt:
- Domain
- DomainId
DomainName:
Label:
zh-cn: 域名
en: Domain Name
Value:
Fn::GetAtt:
- Domain
- DomainName
Protocol:
Label:
zh-cn: 协议类型
en: Protocol
Value:
Fn::GetAtt:
- Domain
- Protocol
TlsMin:
Label:
zh-cn: TLS最低版本
en: TLS Minimum Version
Value:
Fn::GetAtt:
- Domain
- TlsMin
TlsMax:
Label:
zh-cn: TLS最高版本
en: TLS Maximum Version
Value:
Fn::GetAtt:
- Domain
- TlsMax{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建HTTPS域名,配置SSL证书并启用强制HTTPS跳转。",
"en": "Create an HTTPS domain with SSL certificate and force HTTPS redirect."
},
"Parameters": {
"DomainName": {
"Type": "String",
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Description": {
"zh-cn": "API网关的域名,例如api.example.com。需已完成域名备案和DNS解析。",
"en": "The domain name for API Gateway. DNS resolution and ICP filing must be completed."
},
"AllowedPattern": "^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$"
},
"CertIdentifier": {
"Type": "String",
"Label": {
"zh-cn": "SSL证书标识",
"en": "SSL Certificate Identifier"
},
"Description": {
"zh-cn": "SSL证书的唯一标识,可在SSL证书服务控制台获取。证书需与域名匹配。",
"en": "The unique identifier of the SSL certificate, obtainable from the SSL Certificates Service console. The certificate must match the domain name."
}
},
"TlsMin": {
"Type": "String",
"Label": {
"zh-cn": "TLS最低版本",
"en": "TLS Minimum Version"
},
"Description": {
"zh-cn": "允许的TLS协议最低版本。建议生产环境至少使用TLS 1.2。",
"en": "The minimum allowed TLS protocol version. TLS 1.2 or above is recommended for production."
},
"Default": "TLS 1.2",
"AllowedValues": [
"TLS 1.0",
"TLS 1.1",
"TLS 1.2",
"TLS 1.3"
]
},
"TlsMax": {
"Type": "String",
"Label": {
"zh-cn": "TLS最高版本",
"en": "TLS Maximum Version"
},
"Description": {
"zh-cn": "允许的TLS协议最高版本。",
"en": "The maximum allowed TLS protocol version."
},
"Default": "TLS 1.3",
"AllowedValues": [
"TLS 1.0",
"TLS 1.1",
"TLS 1.2",
"TLS 1.3"
]
}
},
"Resources": {
"Domain": {
"Type": "ALIYUN::APIG::Domain",
"Properties": {
"DomainName": {
"Ref": "DomainName"
},
"Protocol": "HTTPS",
"CertIdentifier": {
"Ref": "CertIdentifier"
},
"TlsMin": {
"Ref": "TlsMin"
},
"TlsMax": {
"Ref": "TlsMax"
},
"ForceHttps": true
}
}
},
"Outputs": {
"DomainId": {
"Label": {
"zh-cn": "域名ID",
"en": "Domain ID"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainId"
]
}
},
"DomainName": {
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainName"
]
}
},
"Protocol": {
"Label": {
"zh-cn": "协议类型",
"en": "Protocol"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"Protocol"
]
}
},
"TlsMin": {
"Label": {
"zh-cn": "TLS最低版本",
"en": "TLS Minimum Version"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"TlsMin"
]
}
},
"TlsMax": {
"Label": {
"zh-cn": "TLS最高版本",
"en": "TLS Maximum Version"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"TlsMax"
]
}
}
}
}Scenario 3: Create an HTTPS domain name for API Gateway with custom TLS cipher suites, HTTP/2, and security hardening
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建安全加固的HTTPS域名,配置自定义加密套件、启用HTTP/2并指定资源组。
en: Create a security-hardened HTTPS domain with custom cipher suites, HTTP/2, and resource group.
Parameters:
DomainName:
Type: String
Label:
zh-cn: 域名
en: Domain Name
Description:
zh-cn: API网关的域名,例如api.example.com。需已完成域名备案和DNS解析。
en: The domain name for API Gateway. DNS resolution and ICP filing must be completed.
AllowedPattern: '^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$'
CertIdentifier:
Type: String
Label:
zh-cn: SSL证书标识
en: SSL Certificate Identifier
Description:
zh-cn: >-
SSL证书的唯一标识,可在SSL证书服务控制台获取。
证书需与域名匹配。
en: >-
The unique identifier of the SSL certificate.
The certificate must match the domain name.
ResourceGroupId:
Type: String
Label:
zh-cn: 资源组ID
en: Resource Group ID
Description:
zh-cn: 域名所属的资源组ID,用于权限隔离和成本管理。
en: The resource group ID for permission isolation and cost management.
AssociationProperty: ALIYUN::ResourceManager::ResourceGroup
Default: Null
Http2Option:
Type: String
Label:
zh-cn: HTTP/2设置
en: HTTP/2 Option
Description:
zh-cn: >-
HTTP/2协议设置。Open表示开启,Close表示关闭,
GlobalConfig表示跟随全局配置。
en: >-
HTTP/2 protocol setting. Open to enable, Close to disable,
GlobalConfig to follow global settings.
Default: Open
AllowedValues:
- Open
- Close
- GlobalConfig
Resources:
Domain:
Type: ALIYUN::APIG::Domain
Properties:
DomainName:
Ref: DomainName
Protocol: HTTPS
CertIdentifier:
Ref: CertIdentifier
ForceHttps: true
Http2Option:
Ref: Http2Option
TlsMin: TLS 1.2
TlsMax: TLS 1.3
ResourceGroupId:
Ref: ResourceGroupId
TlsCipherSuitesConfig:
ConfigType: custom
TlsCipherSuite:
- Name: TLS_AES_128_GCM_SHA256
- Name: TLS_AES_256_GCM_SHA384
- Name: TLS_CHACHA20_POLY1305_SHA256
- Name: ECDHE-ECDSA-AES128-GCM-SHA256
- Name: ECDHE-RSA-AES128-GCM-SHA256
- Name: ECDHE-ECDSA-AES256-GCM-SHA384
- Name: ECDHE-RSA-AES256-GCM-SHA384
Outputs:
DomainId:
Label:
zh-cn: 域名ID
en: Domain ID
Value:
Fn::GetAtt:
- Domain
- DomainId
DomainName:
Label:
zh-cn: 域名
en: Domain Name
Value:
Fn::GetAtt:
- Domain
- DomainName
Protocol:
Label:
zh-cn: 协议类型
en: Protocol
Value:
Fn::GetAtt:
- Domain
- Protocol
Http2Option:
Label:
zh-cn: HTTP/2设置
en: HTTP/2 Option
Value:
Fn::GetAtt:
- Domain
- Http2Option
ForceHttps:
Label:
zh-cn: 是否强制HTTPS
en: Force HTTPS
Value:
Fn::GetAtt:
- Domain
- ForceHttps
TlsCipherSuitesConfig:
Label:
zh-cn: 加密套件配置
en: TLS Cipher Suites Config
Value:
Fn::GetAtt:
- Domain
- TlsCipherSuitesConfig
ResourceGroupId:
Label:
zh-cn: 资源组ID
en: Resource Group ID
Value:
Fn::GetAtt:
- Domain
- ResourceGroupId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建安全加固的HTTPS域名,配置自定义加密套件、启用HTTP/2并指定资源组。",
"en": "Create a security-hardened HTTPS domain with custom cipher suites, HTTP/2, and resource group."
},
"Parameters": {
"DomainName": {
"Type": "String",
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Description": {
"zh-cn": "API网关的域名,例如api.example.com。需已完成域名备案和DNS解析。",
"en": "The domain name for API Gateway. DNS resolution and ICP filing must be completed."
},
"AllowedPattern": "^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$"
},
"CertIdentifier": {
"Type": "String",
"Label": {
"zh-cn": "SSL证书标识",
"en": "SSL Certificate Identifier"
},
"Description": {
"zh-cn": "SSL证书的唯一标识,可在SSL证书服务控制台获取。证书需与域名匹配。",
"en": "The unique identifier of the SSL certificate. The certificate must match the domain name."
}
},
"ResourceGroupId": {
"Type": "String",
"Label": {
"zh-cn": "资源组ID",
"en": "Resource Group ID"
},
"Description": {
"zh-cn": "域名所属的资源组ID,用于权限隔离和成本管理。",
"en": "The resource group ID for permission isolation and cost management."
},
"AssociationProperty": "ALIYUN::ResourceManager::ResourceGroup",
"Default": null
},
"Http2Option": {
"Type": "String",
"Label": {
"zh-cn": "HTTP/2设置",
"en": "HTTP/2 Option"
},
"Description": {
"zh-cn": "HTTP/2协议设置。Open表示开启,Close表示关闭,GlobalConfig表示跟随全局配置。",
"en": "HTTP/2 protocol setting. Open to enable, Close to disable, GlobalConfig to follow global settings."
},
"Default": "Open",
"AllowedValues": [
"Open",
"Close",
"GlobalConfig"
]
}
},
"Resources": {
"Domain": {
"Type": "ALIYUN::APIG::Domain",
"Properties": {
"DomainName": {
"Ref": "DomainName"
},
"Protocol": "HTTPS",
"CertIdentifier": {
"Ref": "CertIdentifier"
},
"ForceHttps": true,
"Http2Option": {
"Ref": "Http2Option"
},
"TlsMin": "TLS 1.2",
"TlsMax": "TLS 1.3",
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"TlsCipherSuitesConfig": {
"ConfigType": "custom",
"TlsCipherSuite": [
{
"Name": "TLS_AES_128_GCM_SHA256"
},
{
"Name": "TLS_AES_256_GCM_SHA384"
},
{
"Name": "TLS_CHACHA20_POLY1305_SHA256"
},
{
"Name": "ECDHE-ECDSA-AES128-GCM-SHA256"
},
{
"Name": "ECDHE-RSA-AES128-GCM-SHA256"
},
{
"Name": "ECDHE-ECDSA-AES256-GCM-SHA384"
},
{
"Name": "ECDHE-RSA-AES256-GCM-SHA384"
}
]
}
}
}
},
"Outputs": {
"DomainId": {
"Label": {
"zh-cn": "域名ID",
"en": "Domain ID"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainId"
]
}
},
"DomainName": {
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainName"
]
}
},
"Protocol": {
"Label": {
"zh-cn": "协议类型",
"en": "Protocol"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"Protocol"
]
}
},
"Http2Option": {
"Label": {
"zh-cn": "HTTP/2设置",
"en": "HTTP/2 Option"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"Http2Option"
]
}
},
"ForceHttps": {
"Label": {
"zh-cn": "是否强制HTTPS",
"en": "Force HTTPS"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"ForceHttps"
]
}
},
"TlsCipherSuitesConfig": {
"Label": {
"zh-cn": "加密套件配置",
"en": "TLS Cipher Suites Config"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"TlsCipherSuitesConfig"
]
}
},
"ResourceGroupId": {
"Label": {
"zh-cn": "资源组ID",
"en": "Resource Group ID"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"ResourceGroupId"
]
}
}
}
}