How to Route Asynchronous Lambda Invocation Errors?

AWS Lambda / Serverless Error Handling

A company has an analytics application that uses an AWS Lambda function to process transaction data asynchronously. A developer notices that asynchronous invocations of the Lambda function sometimes fail. When failed Lambda function invocations occur, the developer wants to invoke a second Lambda function to handle errors and log details. Which solution will meet these requirements?

  1. Configure a Lambda function destination with a failure condition. Specify Lambda function as the destination type. Specify the error-handling Lambda function's Amazon Resource Name (ARN) as the resource. Source Reference Answer
  2. Enable AWS X-Ray active tracing on the initial Lambda function. Configure X-Ray to capture stack traces of the failed invocations. Invoke the error-handling Lambda function by including the stack traces in the event object.
  3. Configure a Lambda function trigger with a failure condition. Specify Lambda function as the destination type. Specify the error-handling Lambda function's Amazon Resource Name (ARN) as the resource.
  4. Create a status check alarm on the initial Lambda function. Configure the alarm to invoke the error-handling Lambda function when the alarm is initiated. Ensure that the alarm passes the stack trace in the event object.

Community Votes

A
100%

100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Tests knowledge of Lambda async routing controls, with the common trap confusing outbound destinations with inbound triggers.

This scenario evaluates configuring Lambda destinations for asynchronous invocation error routing. Community consensus confirms destinations are the native, code-free mechanism to automatically invoke a secondary function upon failure.

Option C is frequently selected incorrectly because candidates misinterpret triggers as post-execution handlers, whereas triggers actually initiate invocations from external event sources.

Community Discussion (5 comments)

65703c1 👍 2 Selected: A
A is the correct answer.
SerialiDr 👍 3 Selected: A
Lambda destinations allow you to configure what happens to Lambda function invocation records when an invocation is successful or, in this case, when it fails. By setting a destination for failed invocations, you can specify another Lambda function to handle errors. This setup enables automatic error handling without requiring changes to the application code or the use of additional services for monitoring and triggering error-handling mechanisms. The error-handling Lambda function can then log details, send notifications, or take corrective actions as needed.
KarBiswa 👍 1 Selected: A
https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations
monishvster 👍 1 Selected: A
Should be A since Trigger is before execution
CrescentShared 👍 2 Selected: A
is not a valid approach because Lambda does not have a direct configuration for triggers based on failure conditions in the way described. The concept of a trigger is generally used for starting an invocation, not handling failures.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Lambda destinations natively support routing successful or failed asynchronous invocations to targets like SQS, SNS, EventBridge, or another Lambda function. By configuring a destination with a failure condition and specifying the ARN of the error-handling function, AWS automatically invokes it when the primary function throws an error or times out. This approach requires zero code changes and aligns perfectly with serverless best practices for decoupled error handling.

Why the Other Options Are Wrong

Option B misuses X-Ray, which is strictly for distributed tracing and debugging, not for automated error routing. Option C incorrectly suggests a failure trigger, but Lambda triggers are inbound event sources that start execution, not outbound post-execution handlers. Option D relies on CloudWatch alarms, which monitor aggregate metrics over time rather than individual invocation failures and cannot reliably pass specific stack traces to downstream functions.

Community Comment Notes

Contributors consistently validate option A by referencing AWS documentation on asynchronous invocation destinations. Comment [1] highlights that destinations enable automatic error handling without modifying application code. Comment [2] correctly clarifies that Lambda lacks direct failure-based triggers, reinforcing why option C is invalid. Comment [3] provides the official documentation link for quick verification during exam prep.

Official Reference

Exam Strategy

Focus on mastering Lambda's native async features, particularly destinations for both success and failure routing. Always differentiate between inbound triggers (event sources) and outbound destinations (post-execution targets) when designing serverless architectures.

Related Analysis

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide