Specify a Dead Letter Queue on your Event Bridge Rule targets
A dead letter queue is a queue for you to put error message and handle manually or automatically. If you don't specify any on an Event Bridge Rule target, error messages will be lost.
See AWS Documentation about event retry policy and DLQ
Suggested Actions:
- If you use CDK, you can follow this example.
rule.addTarget(
new targets.LambdaFunction(fn, {
deadLetterQueue: queue, // <-- HERE
);
- If you use the Serverless Framework, you can easily add DLQ to your Event Bridge Rules targets.
functions:
myFunction:
handler: index.handler
events:
- eventBridge:
eventBus: custom-saas-events
pattern:
source:
- saas.external
deadLetterQueueArn: # <-- HERE
Fn::GetAtt:
- QueueName
- Arn