|
| 1 | +# 部署 output 参数介绍 |
| 2 | + |
| 3 | +> 组件输出可以在别的组件中通过 `${output:${stage}:${app}:<name>.<variable_name>}` 获取 |
| 4 | +> |
| 5 | +> 例如,如果该组件名称是 `test_name`, ·且只部署于一个地域,则可以通过 `${output:${stage}:${app}:test_name.apigw.url}` 在别的组件中获取该组件的 API 网关的 `url`。 |
| 6 | +
|
| 7 | +| 名称 | 类型 | 描述 | |
| 8 | +| :---------- | :-------------: | :----------------------------------------------------- | ---------------- | |
| 9 | +| templateUrl | string | 未提供代码时的模板代码 url | |
| 10 | +| region | string | 地域信息(只有一个地域时才提供) | |
| 11 | +| scf | [`FunctionOutput | Record<string,FunctionOutput>`](#云函数输出-`FunctionOutput`) | 云函数输出信息 | |
| 12 | +| apigw | [`ApigwOutput | Record<string:ApigwOutput>`](#API-网关输出-`ApigwOutput`) | API 网关输出信息 | |
| 13 | + |
| 14 | +## 云函数输出 `FunctionOutput` |
| 15 | + |
| 16 | +| 名称 | 类型 | 描述 | |
| 17 | +| :------------------- | :------------: | :--------------------- | |
| 18 | +| functionName | string | 云函数名称 | |
| 19 | +| runtime | string | 云运行环境 | |
| 20 | +| namespace | string | 云函数名称空间 | |
| 21 | +| lastVersion | string | 云函数版本 | |
| 22 | +| traffic | `number (0~1)` | 将多少流量导向该云函数 | |
| 23 | +| configTrafficVersion | string | | |
| 24 | + |
| 25 | +## API 网关输出 `ApigwOutput` |
| 26 | + |
| 27 | +| 名称 | 类型 | 描述 | |
| 28 | +| :------------ | :------------------------------------------------------------------: | :------------------------- | ------- | -------- | |
| 29 | +| serviceId | string | API 网关 ID | |
| 30 | +| subDomain | string | API 网关子域名 | |
| 31 | +| enviroment | `"release" | "prepub" | "test"` | API 网关 | |
| 32 | +| url | string | API 网关对外的完整 URL | |
| 33 | +| traffic | number (0~1) | 将多少流量导向该云函数 | |
| 34 | +| customDomains | [CustomDomain[]](#API-网关自定义域名输出-`ApigwOutput.CustomDomain`) | API 网关自定义域名输出列表 | |
| 35 | + |
| 36 | +## API 网关自定义域名输出 `ApigwOutput.CustomDomain` |
| 37 | + |
| 38 | +| 名称 | 类型 | 描述 | |
| 39 | +| :--------------- | :----------------------------------------------------------------: | :------------------------- | ---------- | |
| 40 | +| domain | string | 自定义域名 | |
| 41 | +| certificateId | string | 域名证书 ID | |
| 42 | +| isDefaultMapping | boolean | 该自定义域名是否为默认域名 | |
| 43 | +| pathMappingSet | [PathMapping[]](#-API-网关域名映射规则-`CustomDomain.PathMapping`) | 该域名的路径映射规则列表 | |
| 44 | +| protocols | `"http" | "https"` | 启用的协议 | |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +## API 网关域名映射规则 `CustomDomain.PathMapping` |
| 49 | + |
| 50 | +| 名称 | 类型 | 描述 | |
| 51 | +| :--------- | :----: | :--------------- | |
| 52 | +| path | string | 路径 | |
| 53 | +| enviroment | string | 路径映射到的环境 | |
| 54 | + |
0 commit comments