AWS Certified Developer – Associate (DVA-C02) — Question 504

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?

Answer options

Correct answer: B

Explanation

For asynchronous invocations, AWS Lambda allows developers to configure destinations to route execution results, including sending failed execution records to an Amazon SNS topic. Specifying the ErrorTopic ARN as the on-failure destination for the ProcessMessages function ensures failures are automatically forwarded there. Other options involving SNS subscription filters or delivery policies are incorrect because they cannot natively intercept and handle Lambda execution failures.