-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
97 lines (91 loc) · 2.16 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
org: alphaser
app: worklogger
service: worklogger
provider:
name: aws
runtime: nodejs16.x
httpApi:
disableDefaultEndpoint: true
endpointType: regional
iam:
role:
statements:
- Effect: "Allow"
Action:
- "s3:PutObject"
- "s3:GetObject"
Resource: "arn:aws:s3:::worklogger/*"
- Effect: "Allow"
Action:
- "ses:SendEmail"
Resource: "*"
functions:
logTimesheets:
handler: lambdaHandler.logTimesheets
name: worklogger-logTimesheets-${opt:stage, 'dev'}
description: Logs timesheets from different sources
memorySize: 128
timeout: 60
package:
patterns:
- "*.js"
- "app/**/*.js"
events:
# TODO make these configurable per deployment
- schedule:
rate: cron(0 11 * * ? *)
enabled: true
description: Daily run
input:
s3: worklogger
c: daily_configuration.json
- schedule:
rate: cron(0 11 1 * ? *)
enabled: true
description: Monthly run
input:
s3: worklogger
c: monthly_configuration.json
- schedule:
rate: rate(1 minute)
enabled: false
description: Test hook for quick usage
input:
s3: worklogger
c: test_config.json
tokenLogger:
handler: lambdaHandler.storeToken
name: worklogger-storeToken-${opt:stage, 'dev'}
description: Stores the token from the OAuth flow
memorySize: 128
timeout: 30
package:
patterns:
- "*.js"
- "app/**/*.js"
events:
- http:
path: /token
method: get
cors: true
login:
handler: lambdaHandler.loginRedirect
name: worklogger-loginRedirect-${opt:stage, 'dev'}
description: Redirects to the OAuth flow
memorySize: 128
timeout: 30
package:
patterns:
- "*.js"
- "app/**/*.js"
events:
- http:
path: /login
method: get
plugins:
- serverless-offline
- serverless-event-constant-inputs
- serverless-webpack
custom:
webpack:
includeModules: true