AWS Certified Developer Associate DVA-C02 Practice Question
A developer is building an application that uses an AWS Lambda function to process images uploaded to an Amazon S3 bucket. The function is invoked asynchronously. Occasionally, malformed image files cause the function to fail repeatedly. The developer needs a way to automatically isolate these failed events for later analysis without losing the event data. What is the most effective solution?
Configure a Lambda destination with a condition of 'On Success' to route failed events.
Increase the function's memory and timeout values in the function configuration.
Configure a dead-letter queue (DLQ) on the Lambda function to send the failed events to an Amazon SQS queue.
Enable active tracing with AWS X-Ray for the Lambda function to capture the exceptions.
The correct answer is to configure a dead-letter queue (DLQ) for the Lambda function. For asynchronous invocations, such as those from Amazon S3, Lambda retries on failure. If retries are exhausted, the event is discarded. A DLQ, which can be an Amazon SQS queue or an Amazon SNS topic, captures these discarded events, allowing developers to inspect and analyze them later. Increasing the timeout or memory might help with performance issues but won't solve failures from malformed data. AWS X-Ray is for tracing and performance analysis, not for capturing the failed event payload for reprocessing.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a dead-letter queue (DLQ)?
Open an interactive chat with Bash
How does the error handling mechanism in AWS Lambda work?
Open an interactive chat with Bash
Why is it important to configure a DLQ for Lambda functions?
Open an interactive chat with Bash
AWS Certified Developer Associate DVA-C02
Development with AWS Services
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access