-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
34 lines (31 loc) · 907 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
# Happy Coding!
service: dynamodb-trigger-cache-hydrator
provider:
name: aws
runtime: nodejs16.x
region: us-east-1
environment:
DYNAMODB_TABLE: YOUR_TABLE
REDIS_HOST: !ImportValue YOUR_REDIS_HOST
REDIS_PORT: 6379
REDIS_TTL: 43200 # 12 hours - you might want to change this
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:GetRecords
- dynamodb:GetShardIterator
- dynamodb:DescribeStream
- dynamodb:ListStreams
- dynamodb:BatchGetItem
Resource:
- arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}
functions:
process:
handler: handler.process
description: Hydrates Cache # you might want to change this
reservedConcurrency: 10
events:
- stream:
type: dynamodb
arn:
!ImportValue YOUR_TABLE_STREAM_ARN