-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
298 lines (275 loc) · 7.59 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
service: micro-bots
frameworkVersion: "3"
provider:
name: aws
runtime: nodejs20.x
region: eu-central-1
stage: production
stackTags:
Project: micro-bots
GitlabProjectId: "20934853"
GitlabProjectUrl: https://gitlab.com/newcubator/newcubator/micro-bots
Environment: ${opt:stage, 'dev'}
iam:
role:
statements:
- Effect: "Allow"
Action:
- "ses:SendEmail"
Resource: "arn:aws:ses:eu-central-1:931595285256:identity/newcubator.com"
- Effect: "Allow"
Action:
- "events:PutEvents"
Resource:
- "*"
# https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2
lambdaHashingVersion: 20201221
eventBridge:
# https://www.serverless.com/framework/docs/deprecations/#AWS_EVENT_BRIDGE_CUSTOM_RESOURCE
useCloudFormation: true
environment:
NODE_OPTIONS: --enable-source-maps
AWS_ACCESS_KEY_ID_GOOGLE: ${env:AWS_ACCESS_KEY_ID_GOOGLE}
AWS_SECRET_ACCESS_KEY_GOOGLE: ${env:AWS_SECRET_ACCESS_KEY_GOOGLE}
GITLAB_BOOK_PROJECT_ID: ${env:GITLAB_BOOK_PROJECT_ID}
GITLAB_TOKEN: ${env:GITLAB_TOKEN}
JIRA_PASSWORD_KWS: ${env:JIRA_PASSWORD_KWS}
JIRA_USER_KWS: ${env:JIRA_USER_KWS}
MOCO_TOKEN: ${env:MOCO_TOKEN}
SLACK_TOKEN: ${env:SLACK_TOKEN}
GENERAL_CHANNEL: ${env:GENERAL_CHANNEL}
plugins:
- serverless-esbuild
- serverless-sentry
- serverless-prune-plugin
custom:
esbuild:
bundle: true
sourcemap: true
sentry:
dsn: ${env:SENTRY_DSN}
prune:
automatic: true
number: 5
functions:
birthday:
environment:
LEAD_TIME: 21
events:
- schedule:
enabled: true
rate: cron(5 4 * * ? *) # at 4:05 AM (UTC) every day
handler: src/functions/birthday.handler
memorySize: 128
timeout: 10
bookIssueReminder:
environment:
GITLAB_PROJECT_ID: ${env:GITLAB_BOOK_PROJECT_ID}
SLACK_CHANNEL_ID: ${env:GENERAL_CHANNEL}
events:
- schedule:
enabled: true
rate: cron(5 4 * * ? *) # at 4:05 AM (UTC) every day
handler: src/functions/gitlab-issue-reminder.handler
memorySize: 128
timeout: 20
##
## Completion Notice
##
completionNoticeCommand:
handler: src/completion-notice/command-handler.commandHandler
timeout: 3
events:
- http:
method: post
path: completion-notice-command
completionNoticeEvent:
handler: src/completion-notice/event-handler.eventHandler
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "CompletionNoticeRequestedEvent"
contactRequest:
events:
- http:
cors: true
method: post
path: contactRequest
handler: src/functions/contact-request.handler
memorySize: 128
eventApplication:
events:
- http:
cors: true
method: post
path: eventApplication
handler: src/functions/event-application.handler
memorySize: 128
kwsReport:
handler: src/kws-report/command-handler.commandHandler
timeout: 25
events:
- http:
method: post
path: kws-report
kwsReportEvent:
handler: src/kws-report/event-handler.eventHandler
timeout: 25
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "KWSExcelExportRequestedEvent"
##
## Lock Project
##
lockProjectCommand:
handler: src/lock-project/command-handler.commandHandler
timeout: 3
events:
- http:
method: post
path: lock-project-command
lockProjectEvent:
handler: src/lock-project/event-handler.eventHandler
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "LockProjectRequestedEvent"
mailSignature:
events:
- http:
method: post
path: mailSignature
handler: src/functions/mail-signature.handler
memorySize: 128
mailSignatureGenerator:
events:
- http:
method: get
path: mailSignatureGenerator
handler: src/functions/mail-signature-generator.handler
memorySize: 128
privateChannelCommand:
handler: src/private-channel/command-handler.commandHandler
timeout: 3
events:
- http:
method: post
path: private-channel-command
privateChannelEvent:
handler: src/private-channel/event-handler.eventHandler
timeout: 20
maximumRetryAttempts: 0
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "PrivateChannelRequestedEvent"
selectMenuHandler:
handler: src/slack/select-menu-handler.selectMenuHandler
timeout: 3
environment:
EVENT_BUS: micro-bots-event
events:
- http:
method: post
path: select-menu-handler
shortMailCommand:
handler: src/short-mail/command-handler.commandHandler
timeout: 3
events:
- http:
method: post
path: short-mail-command
shortMailEvent:
handler: src/short-mail/event-handler.eventHandler
timeout: 20
maximumRetryAttempts: 0
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "ShortMailRequestedEvent"
sickNoteCommand:
handler: src/sick-note/command-handler.commandHandler
timeout: 3
events:
- http:
method: post
path: sick-note-command
sickNoteEvent:
handler: src/sick-note/event-handler.eventHandler
timeout: 20
maximumRetryAttempts: 0
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "SickNoteRequestedEvent"
slackInteraction:
handler: src/slack/interaction-handler.interactionHandler
timeout: 3
environment:
EVENT_BUS: micro-bots-event
events:
- http:
method: post
path: slack-interaction
##
## Unlock Project
##
unlockProjectCommand:
handler: src/unlock-project/command-handler.commandHandler
timeout: 3
events:
- http:
method: post
path: unlock-project-command
unlockProjectEvent:
handler: src/unlock-project/event-handler.eventHandler
events:
- eventBridge:
eventBus: micro-bots-event
pattern:
detail-type:
- "UnLockProjectRequestedEvent"
vacationHandover:
events:
- schedule:
enabled: true
rate: cron(5 4 * * ? *) # at 4:05 AM (UTC) every day
environment:
GITLAB_NEWCUBATOR_GROUP_ID: ${env:GITLAB_NEWCUBATOR_GROUP_ID}
handler: src/functions/vacation-handover.handler
memorySize: 128
holidaySetAutomaticMailReplies:
handler: src/functions/holiday-set-automatic-mail-replies.handler
timeout: 3
events:
- schedule:
enabled: false
rate: cron(5 4 * * ? *) # at 4:05 AM (UTC) every day
environment:
HOLIDAY_MAIL_REPLIES_CHANGE_SLACK_CHANNEL: ${env:HOLIDAY_MAIL_REPLIES_CHANGE_SLACK_CHANNEL}
MICROSOFT_TOKEN: ${env:MICROSOFT_TOKEN}
MICROSOFT_CLIENT_ID: ${env:MICROSOFT_CLIENT_ID}
MICROSOFT_CLIENT_SECRET: ${env:MICROSOFT_CLIENT_SECRET}
recruitmentIncomingMail:
handler: src/recruitment/incoming-mail.handler
memorySize: 256
url: true
tracing: Active
environment:
GITLAB_TOKEN: ${env:GITLAB_TOKEN_RECRUITMENT}
MICROSOFT_TOKEN: ${env:MICROSOFT_TOKEN}
MICROSOFT_CLIENT_ID: ${env:MICROSOFT_CLIENT_ID}
MICROSOFT_CLIENT_SECRET: ${env:MICROSOFT_CLIENT_SECRET}