ALIYUN::FC3::CustomDomain类型用于函数计算 FC 3.0创建自定义域名。
语法
{
"Type": "ALIYUN::FC3::CustomDomain",
"Properties": {
"AuthConfig": Map,
"DomainName": String,
"Protocol": String,
"CertConfig": Map,
"RouteConfig": Map,
"TlsConfig": Map,
"WafConfig": Map
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
AuthConfig | Map | 是 | 是 | 权限认证配置。 | 更多信息,请参见AuthConfig属性。 |
DomainName | String | 是 | 否 | 域名。 | 填写已在阿里云备案或接入备案的自定义域名名称。 |
Protocol | String | 是 | 是 | 域名支持的协议类型。 | 取值:
|
CertConfig | Map | 否 | 是 | HTTPS 证书的信息。 | 更多信息,请参见CertConfig属性。 |
RouteConfig | Map | 否 | 是 | 路由表。 | 自定义域名访问时的 PATH 到 Function 的映射。更多信息,请参见RouteConfig属性。 |
TlsConfig | Map | 否 | 是 | TLS 配置信息。 | 更多信息,请参见TlsConfig属性。 |
WafConfig | Map | 否 | 是 | Web 应用防火墙配置信息。 | 更多信息,请参见WafConfig属性。 |
CertConfig语法
"CertConfig": {
"PrivateKey": String,
"CertName": String,
"Certificate": String
}
CertConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
CertName | String | 是 | 是 | 证书名称。 | 无 |
Certificate | String | 是 | 是 | PEM 格式证书。 | 无 |
PrivateKey | String | 是 | 是 | PEM 格式私钥。 | 无 |
TlsConfig语法
"TlsConfig": {
"MinVersion": String,
"MaxVersion": String,
"CipherSuites": List
}
TlsConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
CipherSuites | List | 是 | 是 | TLS 加密套件列表。 | 最多支持配置100个加密套件。 |
MinVersion | String | 是 | 是 | TLS 最小版本号。 | 枚举值:
|
MaxVersion | String | 否 | 是 | TLS 最大版本号。 | 枚举值:
|
RouteConfig语法
"RouteConfig": {
"Routes": List
}
RouteConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Routes | List | 是 | 是 | 路由配置列表。 | 最多支持配置100个路由配置。更多信息,请参见Routes属性。 |
Routes语法
"Routes": [
{
"Path": String,
"FunctionName": String,
"Qualifier": String,
"RewriteConfig": Map,
"Methods": List
}
]
Routes属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
FunctionName | String | 是 | 是 | 函数名。 | 无 |
Path | String | 是 | 是 | 路由匹配规则。 | 无 |
Qualifier | String | 是 | 是 | 版本或者别名。 | 无 |
Methods | List | 否 | 否 | 支持的方法。 | 取值:
|
RewriteConfig | Map | 否 | 否 | 重写配置。 | 更多信息,请参见RewriteConfig属性。 |
RewriteConfig语法
"RewriteConfig": {
"WildcardRules": List,
"RegexRules": List,
"EqualRules": List
}
RewriteConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
EqualRules | List | 否 | 是 | 精确匹配规则列表。 | 最多支持配置100个规则。更多信息,请参见EqualRules属性。 |
RegexRules | List | 否 | 是 | 正则匹配规则列表。 | 最多支持配置100个规则。更多信息,请参见RegexRules属性。 |
WildcardRules | List | 否 | 是 | 通配匹配规则列表。 | 最多支持配置100个规则。更多信息,请参见WildcardRules属性。 |
WildcardRules语法
"WildcardRules": [
{
"Replacement": String,
"Match": String
}
]
WildcardRules属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Match | String | 是 | 是 | 匹配规则。 | 无 |
Replacement | String | 是 | 是 | 替换规则。 | 无 |
RegexRules语法
"RegexRules": [
{
"Replacement": String,
"Match": String
}
]
RegexRules属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Match | String | 是 | 是 | 匹配规则。 | 无 |
Replacement | String | 是 | 是 | 替换规则。 | 无 |
EqualRules语法
"EqualRules": [
{
"Replacement": String,
"Match": String
}
]
EqualRules属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Match | String | 是 | 否 | 匹配规则。 | 无 |
Replacement | String | 是 | 否 | 替换规则。 | 无 |
AuthConfig语法
"AuthConfig": {
"AuthInfo": String,
"AuthType": String
}
AuthConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
AuthType | String | 是 | 是 | 认证类型。 | 取值:
|
AuthInfo | String | 否 | 是 | 认证信息。 | 无 |
WafConfig语法
"WafConfig": {
"EnableWAF": Boolean
}
WafConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
EnableWAF | Boolean | 否 | 是 | 是否开启 WAF 防护。 | 无 |
返回值
Fn::GetAtt
DomainName:域名。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
DomainName:
Type: String
Description:
en: Domain name. Fill in the custom domain name that has been filed in Ali cloud or access to the record.
Required: true
AuthConfig:
AssociationPropertyMetadata:
Parameters:
AuthInfo:
Type: String
Description:
en: Authentication information.
Required: false
AuthType:
Type: String
Description:
en: Authentication type.
AllowedValues:
- anonymous
- function
- jwt
Required: true
Type: Json
Description:
en: Permission authentication configuration.
Required: true
Protocol:
Type: String
Description:
en: |-
Protocol types supported by the domain name. Valid values:
- HTTP: Only HTTP protocol is supported.
- HTTPS: HTTPS only is supported.
- HTTP,HTTPS: Supports HTTP and HTTPS protocols.
AllowedValues:
- HTTP
- HTTPS
- HTTP,HTTPS
Required: true
Resources:
CustomDomain:
Type: ALIYUN::FC3::CustomDomain
Properties:
DomainName:
Ref: DomainName
AuthConfig:
Ref: AuthConfig
Protocol:
Ref: Protocol
Outputs:
DomainName:
Description: The domain name
Value:
Fn::GetAtt:
- CustomDomain
- DomainName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"DomainName": {
"Type": "String",
"Description": {
"en": "Domain name. Fill in the custom domain name that has been filed in Ali cloud or access to the record."
},
"Required": true
},
"AuthConfig": {
"AssociationPropertyMetadata": {
"Parameters": {
"AuthInfo": {
"Type": "String",
"Description": {
"en": "Authentication information."
},
"Required": false
},
"AuthType": {
"Type": "String",
"Description": {
"en": "Authentication type."
},
"AllowedValues": [
"anonymous",
"function",
"jwt"
],
"Required": true
}
}
},
"Type": "Json",
"Description": {
"en": "Permission authentication configuration."
},
"Required": true
},
"Protocol": {
"Type": "String",
"Description": {
"en": "Protocol types supported by the domain name. Valid values:\n- HTTP: Only HTTP protocol is supported. \n- HTTPS: HTTPS only is supported. \n- HTTP,HTTPS: Supports HTTP and HTTPS protocols."
},
"AllowedValues": [
"HTTP",
"HTTPS",
"HTTP,HTTPS"
],
"Required": true
}
},
"Resources": {
"CustomDomain": {
"Type": "ALIYUN::FC3::CustomDomain",
"Properties": {
"DomainName": {
"Ref": "DomainName"
},
"AuthConfig": {
"Ref": "AuthConfig"
},
"Protocol": {
"Ref": "Protocol"
}
}
}
},
"Outputs": {
"DomainName": {
"Description": "The domain name",
"Value": {
"Fn::GetAtt": [
"CustomDomain",
"DomainName"
]
}
}
}
}