ALIYUN::FC::CustomDomain类型用于创建自定义域名。
语法
{
  "Type": "ALIYUN::FC::CustomDomain",
  "Properties": {
    "ApiVersion": String,
    "Protocol": String,
    "RouteConfig": Map,
    "CertConfig": Map,
    "DomainName": String
  }
}
属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|
| ApiVersion | String | 否 | 是 | API版本 | 无 | 
| Protocol | String | 是 | 是 | 协议类型 | 取值: | 
| RouteConfig | Map | 否 | 是 | 路由表配置 | 详情请参见RouteConfig属性。 | 
| CertConfig | Map | 否 | 是 | 证书信息 | 详情请参见CertConfig属性。 | 
| DomainName | String | 是 | 否 | 域名 | 无 | 
RouteConfig语法
"RouteConfig": {
  "Routes": List
}
RouteConfig属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|
| Routes | List | 是 | 是 | 路由列表 | 详情请参见Routes属性。 | 
Routes语法
"Routes": [
  {
    "Path": String,
    "FunctionName": String,
    "ServiceName": String,
    "Qualifier": String
  }
]  
Routes属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|
| Path | String | 是 | 是 | 自定义域名的请求路径,例如: /login/*。 | 无 | 
| Qualifier | String | 否 | 否 | 别名。 | 无 | 
| FunctionName | String | 是 | 是 | 请求路径对应的函数。 | 无 | 
| ServiceName | String | 是 | 是 | 函数所属服务。 | 无 | 
CertConfig语法
"CertConfig": {
  "CertName": String,
  "PrivateKey": String,
  "Certificate": String
}
CertConfig属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|
| CertName | String | 是 | 是 | 证书的自定义名字 | 无 | 
| PrivateKey | String | 是 | 是 | 私钥 | 使用换行符 \n写成一行。 | 
| Certificate | String | 是 | 是 | 证书内容 | 使用换行符 \n写成一行。 | 
返回值
Fn::GetAtt
- DomainName:域名。
- Domain:协议和域名。
示例
- YAML格式
 - ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  CustomDomain:
    Type: ALIYUN::FC::CustomDomain
    Properties:
      Protocol: HTTP
      DomainName: TestDomain
Outputs:
  DomainName:
    Description: The domain name
    Value:
      Fn::GetAtt:
        - CustomDomain
        - DomainName
  Domain:
    Description: The domain with protocol.
    Value:
      Fn::GetAtt:
        - CustomDomain
        - Domain
 
- JSON格式
 - {
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "CustomDomain": {
      "Type": "ALIYUN::FC::CustomDomain",
      "Properties": {
        "Protocol": "HTTP",
        "DomainName": "TestDomain"
      }
    }
  },
  "Outputs": {
    "DomainName": {
      "Description": "The domain name",
      "Value": {
        "Fn::GetAtt": [
          "CustomDomain",
          "DomainName"
        ]
      }
    },
    "Domain": {
      "Description": "The domain with protocol.",
      "Value": {
        "Fn::GetAtt": [
          "CustomDomain",
          "Domain"
        ]
      }
    }
  }
}