AWS Certified Developer – Associate (DVA-C02) — Question 334
A developer has an application that asynchronously invokes an AWS Lambda function. The developer wants to store messages that resulted in failed invocations of the Lambda function so that the application can retry the call later.
What should the developer do to accomplish this goal with the LEAST operational overhead?
Answer options
- A. Set up Amazon CloudWatch Logs log groups to filter and store the messages in an Amazon S3 bucket. Import the messages in Lambda. Run the Lambda function again.
- B. Configure Amazon EventBridge to send the messages to Amazon Simple Notification Service (Amazon SNS) to initiate the Lambda function again.
- C. Implement a dead-letter queue for discarded messages. Set the dead-letter queue as an 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 pull messages from the SQS queue. Run the Lambda function again.
Correct answer: C
Explanation
Configuring a dead-letter queue (DLQ) using Amazon SQS or Amazon SNS is the native, lowest-overhead method to capture failed asynchronous AWS Lambda invocations. Once configured, setting the DLQ as an event source allows the Lambda function to automatically process and retry the failed messages with minimal manual intervention. Other approaches involving custom CloudWatch log filtering or manual EventBridge routing introduce unnecessary complexity and operational overhead.