By default, a failed Lambda function invoked asynchronously is retried twice, and then the event is discarded. Using Dead Letter Queues (DLQ), you can indicate to Lambda that unprocessed events should be sent to an Amazon SQS queue or Amazon SNS topic instead, where you can take further action.
You configure a DLQ by specifying a target Amazon Resource Name (ARN) on a Lambda function’s
DeadLetterConfig parameter of an Amazon SNS topic or an Amazon SQS queue where you want the event payload delivered, as shown in the following code. For more information about creating an Amazon SNS topic, see Create an SNS Topic. For more information about creating an Amazon SQS queue, see Tutorial: Creating an Amazon SQS Queue.