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?
- A. Increase the Lambda function’s maximum timeout to 15 minutes. Check AWS CloudTrail event history for error details.
- B. Increase the SQS queue’s visibility timeout. Check logs in Amazon CloudWatch Logs for error details.
- C. Create a dead-letter queue. Configure the Lambda function to send failed messages to the dead-letter queue. ✓
- D. Create an Amazon DynamoDB table. Update the Lambda function to send failed messages to the DynamoDB table.
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.