nerdexam
Amazon

DVA-C02 · Question #512

A developer created an AWS Lambda function named ProcessMessages. The Lambda function is invoked asynchronously when a message is published to an Amazon Simple Notification Service (Amazon SNS) topic

The correct answer is B. Configure a failure destination for the ProcessMessages Lambda function. Specify the Amazon. Option B is correct because AWS Lambda natively supports asynchronous invocation destinations - when you configure a failure destination on a Lambda function, Lambda automatically routes the failure event record to a specified target (SNS, SQS, Lambda, or EventBridge) after all r

Submitted by omar99· Mar 5, 2026Development with AWS Services

Question

A developer created an AWS Lambda function named ProcessMessages. The Lambda function is invoked asynchronously when a message is published to an Amazon Simple Notification Service (Amazon SNS) topic named InputTopic. The developer uses a second SNS topic named ErrorTopic to handle alerts of failures for other services. The developer wants to receive notifications from the ErrorTopic SNS topic when the ProcessMessages Lambda function fails to process a message. Which solution will meet this requirement?

Options

  • AConfigure a subscription for the ErrorTopic SNS topic. Configure a filter policy for failures. Specify
  • BConfigure a failure destination for the ProcessMessages Lambda function. Specify the Amazon
  • CConfigure a trigger for the ProcessMessages Lambda function. Specify the ErrorTopic SNS topic
  • DConfigure a delivery policy on the ErrorTopic SNS topic. Configure a filter policy for failures.

How the community answered

(61 responses)
  • A
    16% (10)
  • B
    70% (43)
  • C
    3% (2)
  • D
    10% (6)

Explanation

Option B is correct because AWS Lambda natively supports asynchronous invocation destinations - when you configure a failure destination on a Lambda function, Lambda automatically routes the failure event record to a specified target (SNS, SQS, Lambda, or EventBridge) after all retries are exhausted. This is the purpose-built mechanism for exactly this scenario: capturing async invocation failures and forwarding them to ErrorTopic without any custom code.

Why the distractors fail:

  • A - SNS filter policies control which subscribers receive messages already in a topic; they can't capture Lambda execution failures upstream.
  • C - A Lambda trigger is an event source that invokes the function; adding ErrorTopic as a trigger would make Lambda consume from ErrorTopic, not send failures to it - the logic is backwards.
  • D - SNS delivery policies govern HTTP/S endpoint retry behavior for message delivery, not Lambda execution failures; they operate at the wrong layer entirely.

Memory tip: Think destination = where Lambda sends its outcome. For async invocations, Lambda supports "on success" and "on failure" destinations - the failure destination is AWS's native, zero-code answer to "what happens when async Lambda fails?" If you see async Lambda + failure routing, reach for failure destination first.

Topics

#Lambda Error Handling#Asynchronous Invocation#SNS#Failure Destinations

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice