Describe the feature
For AWS event target SNS Topics can be used and at least in AWS UI it is possible to define a dead letter queue. Sadly this is not possible with CDK. Other Targets like SQS or EventBus does support it already. Check #16417.
Use Case
In case something does not work in event handling a dlq comes in handy, to see why event could not be handled.
Proposed Solution
import * as sns from "@aws-cdk/aws-sns";
import * as sqs from "@aws-cdk/aws-sqs";
import * as events from "@aws-cdk/aws-events";
import * as targets from "@aws-cdk/aws-events-targets";
const targetSQS = new sns.Topic(this, 'targetSNS', {
topicName: 'targetSNS',
});
const rule = new events.Rule(this, 'rule', {
eventPattern: {
source: ["aws.ec2"],
},
});
const myDeadLetterQueue = new sqs.Queue(this, 'myDeadLetterQueue');
rule.addTarget(new targets.SnsTopic(targetSNS, {
deadLetterQueue: myDeadLetterQueue
}));
Other Information
No response
Acknowledgements
CDK version used
1.150.0
Environment details (OS name and version, etc.)
OSX 12.1
Describe the feature
For AWS event target SNS Topics can be used and at least in AWS UI it is possible to define a dead letter queue. Sadly this is not possible with CDK. Other Targets like SQS or EventBus does support it already. Check #16417.
Use Case
In case something does not work in event handling a dlq comes in handy, to see why event could not be handled.
Proposed Solution
Other Information
No response
Acknowledgements
CDK version used
1.150.0
Environment details (OS name and version, etc.)
OSX 12.1