diff --git a/docs/specs/2018-04-03-zh-cn.md b/docs/specs/2018-04-03-zh-cn.md index dd0982e1e..2de458609 100644 --- a/docs/specs/2018-04-03-zh-cn.md +++ b/docs/specs/2018-04-03-zh-cn.md @@ -64,6 +64,7 @@ Resources: - [Aliyun::Serverless::Service](#aliyunserverlessservice) - [Aliyun::Serverless::Function](#aliyunserverlessfunction) +- [Aliyun::Serverless::CustomDomain](#aliyunserverlesscustomdomain) - [Aliyun::Serverless::Api](#aliyunserverlessapi) - [Aliyun:Serverless::TableStore](#aliyunserverlesstablestore) - [Aliyun:Serverless::TableStore::Table](#aliyunserverlesstablestoretable) @@ -122,6 +123,33 @@ MyService: # service name Timeout: 15 ``` +#### Aliyun::Serverless::CustomDomain + +创建自定义域名。自定义域名是函数计算的一个功能,可以通过自定义域名调用函数执行。 + +##### 属性 +属性名称 | 类型 | 描述 +---|:---:|--- +Protocol | `string` | 自定义域名支持的协议类型。 +RouteConfig | [PathConfig](#pathConfig) 数组 | 路由表,配置路径和函数的映射关系。 + +##### 示例:Aliyun::Serverless::CustomDomain + +```yaml +abc.com: # domain name + Type: 'Aliyun::Serverless::CustomDomain' + Properties: + Protocol: HTTP + RouteConfig: + routes: + '/a': + serviceName: serviceA + functionName: functionA + '/b': + serviceName: serviceB + functionName: functionB +``` + #### Aliyun::Serverless::Api 创建可通过 HTTPS 端点调用的阿里云 API 网关资源和方法的集合。 @@ -491,3 +519,16 @@ CodeUri 用来指定代码存储的位置,它可以用来指定: oss 文件:`CodeUri: 'oss://my-fc-testt/2018/helloworld.zip'`。 其中,当指定为 oss 文件时,形式为 `CodeUri: 'oss://bucket-name/filepath'`。 + + +#### PathConfig + +PathConfig 用于设置自定义域名中路径与函数的映射关系。 + +示例: + +``` + '/a': # path + serviceName: serviceA + functionName: functionA +``` \ No newline at end of file diff --git a/docs/specs/2018-04-03.md b/docs/specs/2018-04-03.md index 7564783e2..721675a88 100644 --- a/docs/specs/2018-04-03.md +++ b/docs/specs/2018-04-03.md @@ -61,7 +61,9 @@ Resources: All property names in Aliyun Fun are **case sensitive**. ### Resource types - +- [Aliyun::Serverless::Service](#aliyunserverlessservice) + - [Aliyun::Serverless::Function](#aliyunserverlessfunction) +- [Aliyun::Serverless::CustomDomain](#aliyunserverlesscustomdomain) - [Aliyun::Serverless::Api](#aliyunserverlessapi) - [Aliyun::Serverless::TableStore](#aliyunserverlesstablestore) - [Aliyun:Serverless::TableStore::Table](#aliyunserverlesstablestoretable) @@ -117,6 +119,33 @@ MyService: # service name Timeout: 15 ``` +#### Aliyun::Serverless::CustomDomain + +create Custom Domain。Custom Domain is a feature of Function Compute, users can invoke functions via Custom Domain. + +##### Properties +Property Name | Type | Description +---|:---:|--- +Protocol | `string` | supported protocol +RouteConfig | [PathConfig](#pathConfig) array | mappings of paths and functions + +##### Example:Aliyun::Serverless::CustomDomain + +```yaml +abc.com: # domain name + Type: 'Aliyun::Serverless::CustomDomain' + Properties: + Protocol: HTTP + RouteConfig: + routes: + '/a': + serviceName: serviceA + functionName: functionA + '/b': + serviceName: serviceB + functionName: functionB +``` + #### Aliyun::Serverless::Api Creates a collection of Aliyun API Gateway resources and methods that can be invoked through HTTPS endpoints. @@ -387,4 +416,15 @@ oss file: `CodeUri: 'oss://my-fc-testt/2018/helloworld.zip'`。 Among them, when specified as an oss file, the format is `CodeUri: 'oss://bucket-name/filepath'`. + +#### PathConfig + +PathConfig is used to set mapping relation of path and function. +Example: + +``` + '/a': # path + serviceName: serviceA + functionName: functionA +```