Create Amazon EventBridge schedules using Amazon DynamoDB Streams

DynamoDB → EventBridge Pipes → EventBridge → Lambda → Scheduler

An event-driven pattern that creates three EventBridge schedules for every user inserted into a DynamoDB table.

When a new record is inserted into the DynamoDB database an event is raised to downstream consumers. EventBridge Pipes is used to connect DynamoDB stream to Amazon EventBridge.
The DynamoDB event is transformed into a NewUserCreated event. The schedule creator (Lambda function) consumes this event and creates three schedules for the new user.
Each schedule will trigger the Email Service, 2 minutes, 24 hours and 1 week after the user signs up.
After each schedule is triggered, EventBridge Scheduler deletes the schedule (as the ActionAfterCompletion is set to DELETE).

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-schedule-dynamic-with-auto-deletion

Deploy

npm run buildcdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

David Boyne

David Boyne

Helping people learn about event-driven architectures and serverless

Follow on LinkedIn