DLQ with AWS Lambda

Thiwanka Wickramage
4 min readApr 21, 2023

This is another article on AWS Serverless computing. In this article, we will discuss DLQ (Dead Letter Queue) in AWS Lambda and how to configure it. Before jumping into DLQ configuration, let’s first understand what it is and why we need it.

What is DLQ in AWS Lambda?

DLQ stands for Dead Letter Queue in AWS Lambda. It is a feature that enables you to set up an Amazon SQS queue or an Amazon SNS topic to capture and store failed messages that could not be processed by your Lambda function. This can be useful for debugging and error handling.

If you enable DLQ for your Lambda function, failed events will be sent to the configured SQS queue or SNS topic instead of being discarded. This can help you identify and diagnose the root cause of the failure, and take appropriate action to resolve it.

For example, if your Lambda function is triggered by an S3 bucket and encounters an error while processing a file, the failed event will be sent to the configured DLQ. You can then examine the event to determine why it failed, and possibly correct the issue.

I hope now you have a basic idea about DLQ. For the next step, let’s configure DLQ for your Lambda function.

As I mentioned in the above example, we are going to trigger our Lambda function with S3 bucket event. Let’s create a…