AWS Certified Developer – Associate (DVA-C02) — Question 315
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?
Answer options
- A. 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.
- B. 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.
- C. 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.
- D. 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.
Correct answer: A
Explanation
AWS Lambda destinations allow you to route execution results of asynchronous invocations to other AWS services, including another Lambda function, which is the most efficient native way to handle failed executions. Triggers do not support on-failure conditions for routing in this manner, making Option C incorrect. AWS X-Ray is a debugging and tracing tool rather than an orchestration tool, and status check alarms cannot directly capture and pass execution stack traces to a Lambda function.