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.
Amazon’s Simple Queue Service (SQS) recently gained FIFO (first-in, first-out) queues, which are designed to “guarantee that messages are processed exactly once, in the order that they are sent, and without duplicates”. AWS rolled out this new queue type in the US East (Ohio) and US West (Oregon) regions and “plans to make it available in many others in early 2017”.
Amazon SQS is described as a “fast, reliable, scalable, fully managed message queuing service [designed to] decouple the components of a cloud application [and] transmit any volume of data, without losing messages or requiring other services to be always available”.