A developer's application invokes Lambda functions asynchronously, but some events fail randomly. The developer needs to capture the specific events that failed for investigation. Which configuration will collect failed asynchronous events for later inspection?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure the Lambda function to use an Amazon SQS dead-letter queue and give the function's execution role the required permissions..
Why this is the answer
When a Lambda function is invoked asynchronously, AWS Lambda retries the invocation twice if it fails. If all retries fail, the event is discarded by default. To capture these failed events for investigation, a Dead-Letter Queue (DLQ) is used. Amazon SQS is a supported destination for a Lambda DLQ. By configuring an SQS queue as a DLQ for the Lambda function, any events that fail after all retries will be sent to this SQS queue, allowing the developer to inspect them. The function's execution role needs permissions to send messages to the SQS queue. Using an Amazon Kinesis stream as a DLQ is not a supported option for Lambda. An SQS FIFO queue is unnecessary here as the order of failed events is not a strict requirement, and a standard SQS queue is sufficient and more cost-effective. An EventBridge rule could react to invocation failures, but a DLQ is the direct and intended mechanism for capturing the failed event payload itself in asynchronous invocations.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed