-
Notifications
You must be signed in to change notification settings - Fork 3
/
serverless.yml
180 lines (169 loc) · 4.62 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
service: carbon-mrv-services
provider:
name: aws
runtime: nodejs16.x
stage: ${opt:stage, 'dev'}
region: us-east-1
environment:
NODE_ENV: ${opt:stage, 'dev'}
iam:
role: arn:aws:iam::302213478610:role/lambda-role-dev
vpc:
subnetIds:
- subnet-042cb038d752b50dd
- subnet-0646392cded0ed2f7
securityGroupIds:
- sg-03937a2ebf99900ca
package:
patterns:
- "!node_modules/**"
- ".env"
- .env.${self:provider.stage}
- "countries.json"
- "regions.csv"
- "src/i18n/**"
- "fonts/*"
plugins:
- "serverless-plugin-typescript"
- serverless-plugin-optimize
- serverless-offline
- serverless-ssm-fetch
# - '@haftahave/serverless-ses-template'
params:
local:
depLayerArn1: arn:aws:lambda:us-west-2:111111111111:layer:layer:1
depLayerArn2: arn:aws:lambda:us-west-2:111111111111:layer:layer:1
functions:
national-api:
timeout: 300
handler: src/national-api/handler.handler
events:
- http:
method: any
path: /national/{any+}
- http:
method: any
path: /national
ssmToEnvironment:
- DB_PASSWORD
- USER_JWT_SECRET
- ADMIN_JWT_SECRET
- SMTP_PASSWORD
environment:
NODE_PATH: "./:/opt/node_modules"
layers:
- ${param:depLayerArn1}
- ${param:depLayerArn2}
analytics-api:
timeout: 300
handler: src/analytics-api/handler.handler
events:
- http:
method: any
path: /stats/{any+}
- http:
method: any
path: /stats
ssmToEnvironment:
- DB_PASSWORD
- USER_JWT_SECRET
- ADMIN_JWT_SECRET
- SMTP_PASSWORD
environment:
NODE_PATH: "./:/opt/node_modules"
layers:
- ${param:depLayerArn1}
- ${param:depLayerArn2}
# replicator:
# timeout: 60
# handler: src/ledger-replicator/handler.handler
# events:
# - stream:
# arn: arn:aws:kinesis:us-east-1:302213478610:stream/carbon-stream-${self:provider.stage}
# batchSize: 2
# startingPosition: LATEST
# maximumRetryAttempts: 10
# enabled: true
# ssmToEnvironment:
# - DB_PASSWORD
# - MAPBOX_PK
# - REGISTRY_API_TOKEN
# environment:
# NODE_PATH: "./:/opt/node_modules"
# layers:
# - ${param:depLayerArn1}
# - ${param:depLayerArn2}
data-importer:
timeout: 60
handler: src/data-importer/handler.handler
events:
- schedule:
rate: cron(15 10 * * ? *)
enabled: true
input:
importTypes: CERTIFIER_SCRAPING
ssmToEnvironment:
- DB_PASSWORD
- ITMO_API_KEY
- ITMO_EMAIL
- ITMO_PASSWORD
environment:
NODE_PATH: "./:/opt/node_modules"
layers:
- ${param:depLayerArn1}
- ${param:depLayerArn2}
-async-operations-handler:
timeout: 60
handler: src/async-operations-handler/handler.handler
events:
- sqs:
arn: arn:aws:sqs:us-east-1:302213478610:AsyncQueueMRV${self:provider.stage}.fifo
batchSize: 10
ssmToEnvironment:
- SMTP_PASSWORD
- DB_PASSWORD
- SYNC_API_TOKEN
environment:
NODE_PATH: "./:/opt/node_modules"
layers:
- ${param:depLayerArn1}
- ${param:depLayerArn2}
setup:
timeout: 60
handler: src/setup/handler.handler
ssmToEnvironment:
- DB_PASSWORD
- SMTP_PASSWORD
environment:
NODE_PATH: "./:/opt/node_modules"
layers:
- ${param:depLayerArn1}
- ${param:depLayerArn2}
default:
handler: src/shared/handler.handler
events:
- http:
method: any
path: /{any+}
environment:
NODE_PATH: "./:/opt/node_modules"
layers:
- ${param:depLayerArn1}
- ${param:depLayerArn2}
custom:
optimize:
external: ["swagger-ui-dist"]
serverlessSsmFetch:
DB_PASSWORD: /MRV/${self:provider.stage}/DB_PASSWORD~true
USER_JWT_SECRET: /${self:provider.stage}/USER_JWT_SECRET~true
ADMIN_JWT_SECRET: /${self:provider.stage}/ADMIN_JWT_SECRET~true
SMTP_PASSWORD: /${self:provider.stage}/SES_PASSWORD~true
MAPBOX_PK: /${self:provider.stage}/MAPBOX_PK~true
ITMO_API_KEY: /${self:provider.stage}/ITMO_API_KEY~true
ITMO_EMAIL: /${self:provider.stage}/ITMO_EMAIL~true
ITMO_PASSWORD: /${self:provider.stage}/ITMO_PASSWORD~true
SYNC_API_TOKEN: /${self:provider.stage}/SYNC_API_TOKEN~true
# sesTemplates:
# addStage: true # Specifies whether to add stage to template name (default false)
# configFile: './src/shared/email/email.template.ts' # Config file path (default './ses-email-templates/index.js')
# region: 'us-east-1'