AWS Certified Developer – Associate — Question 373
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 (Amazon CloudWatch Events) 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 (Amazon CloudWatch Events) 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) is a built-in capability of AWS Lambda for asynchronous invocations, allowing failed events to be automatically directed to an Amazon SQS queue or Amazon SNS topic with minimal operational overhead. The other options involve setting up complex log filters, manual S3 exports, or custom EventBridge routing, which significantly increase architectural complexity and maintenance effort.