Q98 — AWS DVA-C02 Ch.3
Question 98 of 100 | ← Chapter 3
A developer has an application that makes asynchronous invocations of an AWS Lambda function. The developer wants to store messages that cause Lambda function invocation failures so the application can retry those invocations later. What should the developer do to achieve this goal with the lowest operational overhead?
- A. Configure an Amazon CloudWatch Logs log group to filter messages and store them in an Amazon S3 bucket. Import the messages in Lambda and re-invoke the Lambda function.
- B. Configure Amazon EventBridge (Amazon CloudWatch Events) to send failed messages to Amazon Simple Notification Service (Amazon SNS) to re-invoke the Lambda function.
- C. Implement a dead-letter queue (DLQ) for failed invocations. Configure the DLQ as an event source for the Lambda function. ✓
- D. Send Amazon EventBridge (Amazon CloudWatch Events) 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) for failed invocations. Configure the DLQ as an event source for the Lambda function.
Explanation
Option C is correct. AWS Lambda natively supports dead-letter queues (DLQs) for asynchronous invocations: when a function fails after retries, Lambda automatically delivers the failed event payload to an SQS queue or SNS topic. Configuring an SQS queue as the DLQ requires minimal setup (a single attribute in the function configuration) and zero custom code or infrastructure. To retry, the developer can configure the same Lambda function (or a dedicated retry handler) to poll the DLQ—leveraging built-in SQS-Lambda integration. Option A involves complex log filtering, S3 storage, and manual import logic. Option B misuses EventBridge (which doesn’t natively capture Lambda failures) and adds SNS fan-out overhead. Option D requires custom event routing and polling logic, increasing complexity and latency. Thus, C delivers the lowest operational overhead while ensuring reliable failure capture and retry capability.