forked from weareadjacent/lambda-lightsail-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
39 lines (35 loc) · 837 Bytes
/
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
service:
name: lightsail-snapshots
# Add the serverless-webpack plugin
plugins:
- serverless-webpack
provider:
name: aws
runtime: nodejs10.x
memorySize: 256
region: ap-southeast-2
logRetentionInDays: 14
timeout: 300
environment:
# BACKUP_INSTANCES: 'instance1,instance2'
# BACKUP_DAYS: 7
# BACKUP_WEEKS: 12
# BACKUP_MONTHS: 12
iamRoleStatements:
- Effect: "Allow"
Action:
- "lightsail:CreateInstanceSnapshot"
- "lightsail:DeleteInstanceSnapshot"
- "lightsail:GetInstanceSnapshot"
- "lightsail:GetInstanceSnapshots"
- "lightsail:GetInstances"
Resource:
- "*"
package:
exclude:
- "**/**.test.*"
functions:
backup:
handler: src/index.handler
events:
- schedule: cron(0 16 * * ? *) # 2am Melbourne Time = 16:00 UTC