-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProcessDynamoDBStream.yaml
45 lines (45 loc) · 1.27 KB
/
ProcessDynamoDBStream.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Serverless Specification template describing your function.
Resources:
ProcessDynamoDBStream:
Type: 'AWS::Serverless::Function'
Properties:
Handler: ProcessDynamoDBStream.lambda_handler
Runtime: nodejs8.10
CodeUri: .
Description: ''
MemorySize: 128
Timeout: 10
Role: 'arn:aws:iam::346214100023:role/lambda-dynamodb-execution-role'
Events:
Schedule1:
Type: Schedule
Properties:
Schedule: rate(1 minute)
DynamoDB1:
Type: DynamoDB
Properties:
Stream:
'Fn::GetAtt':
- Table1
- StreamArn
StartingPosition: TRIM_HORIZON
BatchSize: 100
Environment:
Variables:
TABLE_NAME: homesafe-mobilehub-164224738-user-data
Table1:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
StreamSpecification:
StreamViewType: NEW_IMAGE