-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
Copy pathserverless.yml
35 lines (32 loc) · 980 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
service: serverless-dynamodb-backup
custom:
bucket: EXAMPLE
dynamoDBTableName: "${opt:stage, self:provider.stage}_EXAMPLE"
prefix: FOO
provider:
name: aws
runtime: nodejs12.x
stage: staging
iam:
role:
statements:
- Effect: Allow
Action:
- s3:PutObject
Resource: "arn:aws:s3:::${self:custom.bucket}/${self:custom.prefix}/${self:custom.dynamoDBTableName}/*"
- Effect: Allow
Action:
- "dynamodb:GetRecords"
- "dynamodb:GetShardIterator"
- "dynamodb:DescribeStream"
- "dynamodb:ListStreams"
Resource: "arn:aws:dynamodb:ap-southeast-1:*:table/${self:custom.dynamoDBTableName}/stream/*"
functions:
backup:
handler: handler.backup
environment:
STAGE: "${opt:stage, self:provider.stage}"
BUCKET: "${self:custom.bucket}"
TABLE: "${self:custom.dynamoDBTableName}"
PREFIX: "${self:custom.prefix}"
timeout: 300