DVA-C03 practice question: Lambda invocation, errors and destinations (1 of 2)
Development with AWS Services A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.
An Amazon SNS topic invokes a Lambda function asynchronously for each order message.
When the function fails on all of its retries, the team wants a record of each failed event that includes the function's response, such as its status code and error payload, so that the failures can be analyzed later.
What should the developer configure?
Choose one answer.
AA. A dead-letter queue on the function, using an Amazon SQS queue as the target.
BB. A longer function timeout, together with more retries configured on the topic.
CC. CloudWatch Logs for the function, with a daily search of the logs for error messages.
DD. An on-failure destination for asynchronous invocation, such as an Amazon SQS queue.
Show the answer and explanation
Answer: D
A. Wrong: A dead-letter queue receives the event itself, plus a few attributes such as the start of the error message. It does not include the response details, such as the status code or the error payload.
B. Wrong: A longer timeout records nothing about failures, and more retries only repeat the attempt. Neither keeps the response the team wants to analyze.
C. Wrong: Logs keep whatever the function prints, but they do not keep the failed event for replay, and they are not a structured record of each failure.
For asynchronous invocations, a failure destination receives a record of the failed event that includes the response status and the error payload. A dead-letter queue keeps the event and a few attributes only, so it misses the response details the team needs.
The on-failure destination keeps the function's response with the event. A dead-letter queue keeps only the event.
Want more on Lambda invocation, errors and destinations? The 5 full-length practice sets have 9 more Lambda invocation, errors and destinations questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →