Skip to content

Commit d629f87

Browse files
committed
fix: support eip config
1 parent 1ba846e commit d629f87

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

docs/configure.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ inputs:
3232
version: 1 # 版本
3333
functionConf: # 函数配置相关
3434
timeout: 10 # 超时时间,单位秒
35+
eip: false # 是否固定出口IP
3536
memorySize: 128 # 内存大小,单位MB
3637
environment: # 环境变量
3738
variables: # 环境变量数组
@@ -125,12 +126,13 @@ inputs:
125126

126127
参考: https://cloud.tencent.com/document/product/583/18586
127128

128-
| 参数名称 | 是否必选 | 类型 | 默认值 | 描述 |
129-
| ----------- | :------: | :----: | :----: | :------------------------------------------------------------------------------ |
130-
| timeout | 否 | Number | 3 | 函数最长执行时间,单位为秒,可选值范围 1-900 秒,默认为 3 秒 |
131-
| memorySize | 否 | Number | 128 | 函数运行时内存大小,默认为 128M,可选范围 64、128MB-3072MB,并且以 128MB 为阶梯 |
132-
| environment | 否 | Object | | 函数的环境变量, 参考 [环境变量](#环境变量) |
133-
| vpcConfig | 否 | Object | | 函数的 VPC 配置, 参考 [VPC 配置](#VPC-配置) |
129+
| 参数名称 | 是否必选 | 类型 | 默认值 | 描述 |
130+
| ----------- | :------: | :-----: | :-----: | :------------------------------------------------------------------------------ |
131+
| timeout | 否 | Number | 3 | 函数最长执行时间,单位为秒,可选值范围 1-900 秒,默认为 3 秒 |
132+
| memorySize | 否 | Number | 128 | 函数运行时内存大小,默认为 128M,可选范围 64、128MB-3072MB,并且以 128MB 为阶梯 |
133+
| environment | 否 | Object | | 函数的环境变量, 参考 [环境变量](#环境变量) |
134+
| vpcConfig | 否 | Object | | 函数的 VPC 配置, 参考 [VPC 配置](#VPC-配置) |
135+
| eip | 否 | Boolean | `false` | 是否固定出口 IP |
134136

135137
##### 环境变量
136138

src/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const CONFIGS = {
44
compFullname: 'Koa.js',
55
handler: 'sl_handler.handler',
66
runtime: 'Nodejs10.15',
7-
exclude: ['.git/**', '.gitignore', '.DS_Store'],
87
timeout: 3,
98
memorySize: 128,
109
namespace: 'default',

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
33
"download": "^8.0.0",
4-
"tencent-component-toolkit": "^1.13.0",
4+
"tencent-component-toolkit": "^1.13.2",
55
"type": "^2.0.0"
66
}
77
}

src/utils.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
245245
}),
246246
publish: inputs.publish,
247247
traffic: inputs.traffic,
248-
lastVersion: instance.state.lastVersion
248+
lastVersion: instance.state.lastVersion,
249+
eip: tempFunctionConf.eip === true,
250+
l5enable: tempFunctionConf.l5enable === true
249251
}
250252

251253
// validate traffic
@@ -258,15 +260,6 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
258260
default: null
259261
})
260262

261-
functionConf.include = ensureIterable(
262-
tempFunctionConf.include ? tempFunctionConf.include : inputs.include,
263-
{ default: [], ensureItem: ensureString }
264-
)
265-
functionConf.exclude = ensureIterable(
266-
tempFunctionConf.exclude ? tempFunctionConf.exclude : inputs.exclude,
267-
{ default: [], ensureItem: ensureString }
268-
)
269-
functionConf.exclude.push('.git/**', '.gitignore', '.serverless', '.DS_Store')
270263
if (inputs.functionConf) {
271264
functionConf.timeout = inputs.functionConf.timeout
272265
? inputs.functionConf.timeout

0 commit comments

Comments
 (0)