Course menuDVA-C03

Exams / DVA-C03 / Lambda invocation, errors and destinations / Question 1

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.

Last verified against current AWS documentation ·How we write our questions

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.

  1. A. A dead-letter queue on the function, using an Amazon SQS queue as the target.
  2. B. A longer function timeout, together with more retries configured on the topic.
  3. C. CloudWatch Logs for the function, with a daily search of the logs for error messages.
  4. D. 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.
  • D. Right: Correct. The destination receives a record for each failed event that includes the request payload, the response status and the error payload. Learn more: Capturing records of Lambda asynchronous invocations (opens in a new tab)

Explanation

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.

A Lambda on-failure destination compared with a dead-letter queue An event source such as SNS, EventBridge or S3 invokes a Lambda function asynchronously. When every retry fails, an on-failure destination SQS queue receives a record with the event, the response status code and the error payload. A dead-letter queue, shown for comparison, keeps only the event and a few attributes. Event source SNS, EventBridge, S3 async invoke Lambda function all retries fail SQS queue on-failure destination Dead-letter queue event only record: event, status, error payload
The on-failure destination keeps the function's response with the event. A dead-letter queue keeps only the event.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

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