This repository contains a serverless app that forwards events from a DynamoDB stream to an Amazon EventBridge event bus.
The high-level architecture is as follows:
A common pattern within cloud architectures is to trigger consumers based on changes to data, and this app helps to facilitate this pattern when using AWS services.
DynamoDB streams capture changes to items in a DynamoDB table, and can be used to trigger AWS Lambda functions or other consumers. However, there is a limit of two consumers per DynamoDB stream. This app attaches a single Lambda function to a source DynamoDB stream, which captures the stream events and publishes them to an Amazon EventBridge event bus, which can support up to 100 consumers.
If the fanout Lambda function is unable to publish an event to the event bus after the configured number of retries, it will send the message to an SQS dead letter queue so the particular failure can be investigated.
This app is published as a serverless application in the AWS Serverless Application Repository. You can install it using the following steps:
- Create an AWS account if you do not already have one and login
- Go to this app's page on the Serverless Application Repository
- Provide the required parameters and click "Deploy"
This app has the following parameters:
DynamoDBStreamArn
(required) - The ARN of the source DynamoDB streamEventBusName
(optional) - The name of the event bus to create. Default: defaultEventBridgeMaxAttempt
(optional) - The max attempts to try to put events into the event bus, after which the event will be sent to the dead letter queue. Default: 1
The CloudFormation stack that this app deploys has the following outputs:
FanoutLambdaName
- The name of the created fanout Lambda functionFanoutDlqUrl
- The URL of the created dead letter SQS queue
This project is licensed under the Apache-2.0 License.