Q83 — AWS DVA-C02 Ch.1

Question 83 of 100 | ← Chapter 1

A developer is building an application on AWS. The application includes an AWS Lambda function that processes messages from an Amazon Simple Queue Service (Amazon SQS) queue. The Lambda function occasionally fails or times out. The developer wants to understand why certain messages are not processed successfully. Which solution meets these requirements with the least operational overhead?

Correct Answer: C. Create a dead-letter queue. Configure the Lambda function to send failed messages to the dead-letter queue.

Explanation

Creating a dead-letter queue (DLQ) is the lowest-overhead solution: it requires only SQS and Lambda configuration changes (no code modifications), automatically captures unprocessed messages, and enables post-failure analysis without custom logging or database integration. Option A misuses CloudTrail (which logs API calls, not Lambda execution errors). Option B increases visibility timeout but doesn’t help diagnose root causes. Option D adds unnecessary infrastructure and coding complexity. Thus, C is optimal.