Event-Driven Pipeline
beginnerSNS fan-out to three SQS queues (notify, analytics, audit) each with a Lambda consumer and dead-letter queue. Includes a custom EventBridge bus for cross-service domain events and DLQ alarms.
Quick Start
Via CLI (recommended)
npx cdk-starter create Then select "Event-Driven Pipeline" from the prompt
Or scaffold directly
npx cdk-starter create --starter event-driven-pipeline README
Event-Driven Pipeline
SNS fan-out topic delivers to three independent SQS queues (notify, analytics, audit), each backed by a Lambda consumer with a dead-letter queue. A custom EventBridge bus routes domain events to the topic.
Publish an event
aws sns publish \
--topic-arn <TopicArn> \
--message '{"eventType": "order.created", "orderId": "123"}'
Consumer files
| Consumer | File |
|---|---|
| Notify | src/handlers/notify.ts |
| Analytics | src/handlers/analytics.ts |
| Audit | src/handlers/audit.ts |
Prerequisites
- Node.js ≥ 20
- AWS CLI configured (
aws configure) - CDK bootstrapped (
npx cdk bootstrap)
Deploy
npm install
npx cdk diff
npx cdk deploy
Tear down
npx cdk destroy