-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yaml
75 lines (70 loc) · 2.47 KB
/
serverless.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Ref:
# https://github.com/serverless-components/tencent-scf/blob/master/docs/configure.md.
# https://github.com/serverless/serverless-tencent/discussions/22
# https://github.com/serverless/serverless-tencent/blob/master/docs/basic/variables.md
#
#应用组织信息
org: '' # 组织名称。留空则则使用默认值为用户appid
app: 'bbhj' # 应用名称。留空则默认取当前组件的实例名称为app名称。
#stage: 'test' # 环境名称。默认值是 dev。建议使用${env:STAGE}变量定义环境名称
stage: ${env:STAGE} # 环境名称。默认值是 dev。建议使用${env:STAGE}变量定义环境名称
component: scf
name: bbhj
inputs:
src:
src: ./
hook: "ls"
exclude:
- .env
- .env.test
- .env.release
- .vscode
namespace: ${env:WXKF_NAMESPACE}
region: ap-shanghai
runtime: Go1
handler: main
memorySize: 64 # 内存大小,单位MB
timeout: 5 # 函数执行超时时间,单位秒
initTimeout: 3 # 初始化超时时间,单位秒
environments: # 环境变量
- key: MAIN_DSN_READ2
value: ${output:${stage}:${app}:${name}.${ENV}}
environment: # 环境变量
variables: # 环境变量对象
ENV: ${stage}
env: ${stage}
MAIN_DSN_WRITE: ${env:MAIN_DSN_WRITE}
MAIN_DSN_READ: ${env:MAIN_DSN_READ}
WX_REDIS_ADDR: ${env:WX_REDIS_ADDR}
WX_REDIS_PASSWD: ${env:WX_REDIS_PASSWD}
WX_REDIS_DB: ${env:WX_REDIS_DB}
WXMP_REDIS_DB: ${env:WXMP_REDIS_DB}
WXMP_APPID: ${env:WXMP_APPID}
WXMP_APPSECRET: ${env:WXMP_APPSECRET}
WXKF_CORP_ID: ${env:WXKF_CORP_ID}
WXKF_SECRET: ${env:WXKF_SECRET}
WXKF_TOKEN: ${env:WXKF_TOKEN}
WXKF_ENCODING_AES_KEY: ${env:WXKF_ENCODING_AES_KEY}
TencentyunAppID: ${env:TencentyunAppID}
TencentyunAccessKeyID: ${env:TencentyunAccessKeyID}
TencentyunAccessKeySecret: ${env:TencentyunAccessKeySecret}
TencentyunBucketName: ${env:TencentyunBucketName}
TencentyunRegionID: ${env:TencentyunRegionID}
publicAccess: true # 是否开启公网访问
events:
- apigw:
parameters:
serviceName: serverless
serviceId: ${env:WXKF_SERVICE_ID}
protocols:
- http
- https
environment: ${stage}
endpoints:
- path: /${name}
apiName: ${name}
method: ANY
enableCORS: true
function:
isIntegratedResponse: true
functionQualifier: $DEFAULT