-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
92 lines (82 loc) · 2.71 KB
/
serverless.yml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# serverless.yml
service: nshm-kororaa-apigw
useDotenv: true
provider:
name: aws
runtime: nodejs18.x
stage: dev
region: ap-southeast-2
apiGateway:
apiKeys:
- name: KORORAA_APIGW_TempApiKey-${self:custom.stage}
description: Api key until we have an auth function # Optional
plugins:
- serverless-offline
- serverless-plugin-warmup
- serverless-domain-manager
custom:
# DRY constants: define all compound/generated names in one place
# Override args are: .. defaults:
# --app_acroym signed-uploader
# --s3_bucket self:custom.app_acronym
# --s3_key_base self:custom.stage
# --region us-east-1
# --stage test
# --deletion_policy delete
app_acronym: ${opt:acronym, self:service}
default_stage: dev
stage: ${opt:stage, self:custom.default_stage}
stack_name: ${self:custom.app_acronym}-${self:custom.stage}
region: ${opt:region, self:provider.region}
deletion_policy: Delete
serverless-offline:
httpPort: 4100
# serverless-domain-manager settings
domains:
prod: nshm-api.gns.cri.nz
test: nshm-api-test.gns.cri.nz
dev: nshm-api-dev.gns.cri.nz
customDomain:
domainName: ${self:custom.domains.${self:custom.stage}}
basePath: 'kororaa-app-api' # This will be prefixed to all routes
stage: ${self:custom.stage}
createRoute53Record: false
# Lambda warmer settings see https://www.serverless.com/plugins/serverless-plugin-warmup
warmup:
littleWarmer:
enabled: true
events:
- schedule: rate(5 minutes)
concurrency: 1
functions:
app:
description: The graphql API of ${self:service} in ${self:custom.stage}
handler: handler.handler
memorySize: 2096 # optional, in MB, default is 1024
timeout: 20 # optional, in seconds, default is 6
events:
- http:
path: /{any+}
method: OPTIONS
- http:
path: /{any+}
method: POST
private: true
- http:
path: /{any+}
method: GET
private: true
environment:
BASE_PATH: ${self:custom.customDomain.basePath}
SERVICE_NAME: ${self:service}
STACK_NAME: ${self:custom.stack_name}
REGION: ${self:custom.region}
DEPLOYMENT_STAGE: ${self:custom.stage}
ENABLE_METRICS: ${env:ENABLE_METRICS, 0}
NZSHM22_KORORAA_API_URL: ${env:NZSHM22_KORORAA_API_URL}
NZSHM22_KORORAA_API_KEY: ${env:NZSHM22_KORORAA_API_KEY}
NZSHM22_TOSHI_API_URL: ${env:NZSHM22_TOSHI_API_URL}
NZSHM22_TOSHI_API_KEY: ${env:NZSHM22_TOSHI_API_KEY}
NZSHM22_SOLVIS_API_URL: ${env:NZSHM22_SOLVIS_API_URL}
NZSHM22_SOLVIS_API_KEY: ${env:NZSHM22_SOLVIS_API_KEY}
PINO_LOG_LEVEL: ${env:PINO_LOG_LEVEL, "info"}