Repository navigation
New serverless pattern - dsql-cdc-eventbridge-pipes-typescript-cdk - #3565
Open
NithinChandranR-AWS wants to merge 3 commits into
Conversation
…QL CDC to Amazon EventBridge with Amazon EventBridge Pipes - Amazon EventBridge pipe from Amazon Kinesis Data Streams to a custom event bus: filter, event type from the operation code, reshaped detail - Three rules route every change, inserts and deletes to Amazon SQS queues - Dead-letter queues for the pipe and for the rule targets - AWS CDK TypeScript, no function in the data path
…d test data with the blog post
…d us-east-1, aws-cdk ^2.1149.0
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Amazon Aurora DSQL CDC to Amazon EventBridge with Amazon EventBridge Pipes. Aurora DSQL writes each committed row change to Amazon Kinesis Data Streams; an EventBridge pipe keeps complete records, sets the event type from the record's operation code (
c,u,d), reshapes the change into the event detail and puts it on a custom event bus, where rules send every change to an audit queue, inserts to a validation queue and deletes to an alerts queue in Amazon SQS. There is no function in the data path. Claim issue: #3564.Key Innovation
First Aurora DSQL CDC pattern without a function in the data path. The existing
dsql-cdc-eventbridgepattern publishes the records from an AWS Lambda function and names the eventsINSERT,UPDATEandDELETE; here the pipe's filter,DetailTypeand input template do that work, and the raw operation codes are the event types.Architecture
Amazon Aurora DSQL CDC stream -> Amazon Kinesis Data Streams (on-demand, 10 MiB records) -> Amazon EventBridge pipe (filter
{"data":{"type":["full"]}},DetailType$.data.op, input template, bisect, dead-letter queue) -> custom event bus -> audit, inserts and deletes rules -> Amazon SQS queues, with a shared rule-target dead-letter queueDeployed and Tested
Stack deploys in us-west-2 (~103 s) and us-east-1 (~106 s), 24 CloudFormation resources. The README code blocks ran from a clean clone of this branch in zsh (us-west-2) and bash 3.2 (us-east-1), non-interactively (
cdk --require-approval never/--force, SQL throughpsqlstdin, repeated queue reads), with the same results in both:c,uanddin the audit queue,cin the validation queue,din the alerts queue (a read about 30 s after the SQL was empty, the next at about 85 s had all of them).RetryAttemptsExhausted,KinesisBatchInfo) about 10 s later,TargetInvocationFailedlog lines with the size error, and the ordinary row behind it still reached the audit queue.ERROR_CODENO_PERMISSIONS,RULE_ARNandTARGET_ARN; policy restored afterwards.cdk destroy(~145 s) removed the stack and the custom resource deleted the CDC stream; the custom resource's log group came back without retention, as Cleanup step 4 says, and step 4 removed it; the cluster was deleted. No stack, stream, pipe, log group or cluster left.Checklist
aws:SourceAccountandaws:SourceArn; plus the CDK-managed basic execution role of the custom-resource function)validate.jspasses, including the admin IAM check