cdk-eventbridge-to-sqs
v0.0.2
Published
This is a CDK construct library that allows you to easily create an EventBridge rule that sends events to an SQS queue.
Downloads
5
Readme
cdk-eventbridge-to-sqs
This is a CDK construct library that allows you to easily create an EventBridge rule that sends events to an SQS queue.
Why not use AWS Solutions constructs aws-eventbridge-sqs
?
Because it doesn't support message group id.
So, that's why.
Documentation
Usage
Install
npm install cdk-eventbridge-to-sqs
Import
import { EventbridgeToSqs } from "cdk-eventbridge-to-sqs";
Examples
Create an eventbus and a queue, and connect them
const { queue, eventBus } = new EventbridgeToSqs(this, "EventbridgeToSqs");
Create an eventbus and a queue with custom names, and connect them
const { queue, eventBus } = new EventbridgeToSqs(this, "EventbridgeToSqs", {
eventBusProps: {
eventBusName: "MyEventBus",
},
queueProps: {
queueName: "MyQueue",
},
});
Create an eventbus, a queue and a dead letter queue with custom names, and connect them
const { queue, eventBus } = new EventbridgeToSqs(this, "EventbridgeToSqs", {
eventBusProps: {
eventBusName: "MyEventBus",
},
queueProps: {
fifo: true,
},
deadLetterQueueProps: {
fifo: true,
},
deployDeadLetterQueue: true,
messageGroupId: "MyMessageGroupId",
});
Connect an existing eventbus and queue
declare const queue: Queue;
declare const eventBus: EventBus;
new EventbridgeToSqs(this, "EventbridgeToSqs", {
existingEventBusInterface: eventBus,
existingQueueObj: queue,
});
Custom event rule filter pattern
declare const queue: Queue;
declare const eventBus: EventBus;
new EventbridgeToSqs(this, "EventbridgeToSqs", {
existingEventBusInterface: eventBus,
existingQueueObj: queue,
eventRuleFilterPattern: {
detailType: ["MyDetailType"],
source: ["MySource"],
},
});