Ensure that each Amazon Lambda function created within your AWS cloud account is configured to use a Dead Letter Queue (DLQ) in order to send unprocessed events from asynchronous invocations to an Amazon SQS queue or an Amazon SNS topic.
This rule can help you work with the AWS Well-Architected Framework.
excellence
When an event fails all attempts or stays in the asynchronous invocation queue for too long, Amazon Lambda service discards it. Enabling Dead Letter Queues (DLQs) for your Amazon Lambda functions can make your serverless application more resilient by capturing and storing unprocessed events from asynchronous invocations for further analysis or reprocessing. Configuring Dead Letter Queues for Amazon Lambda functions will give you more control over message handling for all asynchronous invocations, including those delivered via AWS service events (S3, SNS, IoT, etc.).
Audit
To determine if your Amazon Lambda functions are configured to use Dead Letter Queues (DLQs), perform the following actions:
Remediation / Resolution
To enable and configure Dead Letter Queues (DLQs) for your existing Amazon Lambda functions, perform the following actions:
As an example, this section demonstrates how to configure a Dead-Letter Queue to send failed (discarded) events to an Amazon SQS queue. The Amazon SQS queue will hold failed events until they are retrieved. You can retrieve events manually, or you can configure Amazon Lambda to read from the queue and invoke a function.References
- AWS Documentation
- AWS Lambda FAQs
- Asynchronous invocation
- SendMessage
- AWS Command Line Interface (CLI) Documentation
- lambda
- list-functions
- get-function-configuration
- update-function-configuration
- sqs
- create-queue
- get-queue-attributes
Unlock the Remediation Steps
Free 30-day Trial
Automatically audit your configurations with Conformity
and gain access to our cloud security platform.
You are auditing:
Enable Dead Letter Queue for Lambda Functions
Risk Level: Low