I am trying to setup a full local stack for DDB -> DDB stream -> Lambda.
What I have done are:
- Setup local DynamoDB
- Enable DDB Stream. (Tested with list-streams, get-shard, and get-records)
- Setup Local Lambda with SAM. (Can invoke/start Lambda to process sample event json)
In Lambda template.yaml, i have setup below
Events:
DynamoDB1:
Type: DynamoDB
Properties:
Stream: arn:aws:dynamodb:ddblocal:000000000000:table/digital_form/stream/2021-01-10T05:13:58.423
StartingPosition: LATEST
BatchSize: 1
Enabled: true
So the question is, how should I run the lambda so that it can "listening" the record change from DDB stream? Currently SAM only provide Invoke, start-lambda and start-api function which doesn't achieve this.
I have search around internet but unable to found any solution that has been implemented in local environment.