-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
58 lines (50 loc) · 1.66 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
# Helpful docs: https://serverless-stack.com/#the-basics
# https://serverless.com/framework/docs/providers/aws/events/apigateway
service: mfpv-backup
frameworkVersion: '2'
custom:
bundle:
packager: yarn
serverless-offline:
httpPort: 4000
provider:
name: aws
runtime: nodejs12.x
lambdaHashingVersion: 20201221
memorySize: 10240 # optional, in MB, default is 1024
timeout: 900 # optional, in seconds, default is 6
# iam:
# role:
# managedPolicies:
# - 'arn:aws:iam::aws:policy/AmazonElasticFileSystemClientReadWriteAccess'
# apiGateway:
# shouldStartNameWithService: true
#package:
# individually: true # https://www.serverless.com/framework/docs/providers/aws/guide/packaging#packaging-functions-separately
functions:
mfpvBackupWorld: # the name of the lambda. Size of bundle does not seem to affect compute performance but may incur higher memory usage.
handler: src/handlers/backupWorld.handler
events:
- schedule: cron(0 4 * * ? *) # This should be a few minutes after the world starts to back up.
- http:
path: /backup_world
method: ANY
cors: true
async: true
mfpvBackupData:
handler: src/handlers/backupData.handler
events:
- schedule: cron(51 3 * * ? *) # This should be the same time the world starts to back up.
- http:
path: /backup_data
method: ANY
cors: true
async: true
- http:
path: /backup_data_sync
method: ANY
cors: true
plugins:
- serverless-bundle # Package our functions with Webpack
- serverless-offline
- serverless-dotenv-plugin # Load .env as environment variables