Amazon DynamoDB streams to AWS AppSync subscription

Amazon DynamoDB → AWS Lambda → AWS AppSync

Listen to DynamoDB changes using AppSync subscriptions

In some of your projects, you might want to be able to listen to changes made on your database that are not performed through client-side mutations.
This sample project creates an AppSync API allowing you to listen to new items being created on a specific DynamoDB table through AWS AppSync subscriptions.
With this pattern, a Lambda function will be invoked for every new item created on a DynamoDB table. It will in turn call an AppSync mutation with data source set as `None`. An AppSync subscription will be subscribed to that mutation allowing end users to be notified of a newly created DynamoDB item.

< 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/dynamodb-streams-appsync-subscription

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Alexis Philippart de Foy

Alexis Philippart de Foy

I am a Startup Solutions Architect, Serverless Enthusiast and former startup founder.

Follow on LinkedIn