Q22 — AWS DVA-C02 Ch.1
Question 22 of 100 | ← Chapter 1
A developer has an application that asynchronously invokes an AWS Lambda function. The developer wants to store messages that cause Lambda function invocation failures so the application can retry them later. What should the developer do to achieve this with minimal operational overhead?
- A. Configure an Amazon CloudWatch Logs log group to filter and store messages in an Amazon S3 bucket. Import messages in Lambda and re-invoke the Lambda function.
- B. Configure Amazon EventBridge to send messages to Amazon Simple Notification Service (Amazon SNS) to restart the Lambda function.
- C. Implement a dead-letter queue (DLQ). Configure the DLQ as the event source for the Lambda function. ✓
- D. Send Amazon EventBridge events to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the Lambda function to poll messages from the SQS queue and re-invoke itself.
Correct Answer: C. Implement a dead-letter queue (DLQ). Configure the DLQ as the event source for the Lambda function.
Explanation
Option C is correct: configuring a dead-letter queue (DLQ) for a Lambda function automatically captures failed asynchronous invocation events with zero custom code or polling logic. When enabled, Lambda retries failed invocations up to the configured maximum attempts, then delivers the failed event to the DLQ (e.g., an SQS queue or SNS topic). This requires only configuration—no custom logging, polling, or orchestration—and enables reliable, low-overhead retries. Options A, B, and D introduce unnecessary complexity, latency, or operational burden.