An AWS Lambda function is subscribed to an Amazon SNS topic. You must ensure that a record of every Lambda invocation is added to an Amazon SQS queue. Which solution satisfies this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a single asynchronous invocation destination to capture successful invocations. Configure the SQS queue as that destination. Create a CloudWatch alarm on the DestinationDeliveryFailures metric to catch any message delivery failures..
Why this is the answer
The correct solution is to use a single asynchronous invocation destination for successful invocations, configured to send messages to the SQS queue. This ensures that every successful Lambda invocation's details are sent to the queue. Since the Lambda function is subscribed to an SNS topic, it is invoked asynchronously. Lambda's asynchronous invocation model allows configuring destinations for successful or failed invocations. A CloudWatch alarm on DestinationDeliveryFailures is crucial to detect any issues with messages not reaching the SQS queue. Configuring the SQS queue as a dead-letter queue (DLQ) for the Lambda function would only capture failed invocations, not all invocations. Adding SendMessage API calls within the Lambda function itself is less efficient and adds complexity compared to using native Lambda destinations. Adding two separate destinations for success and failure is redundant if you only need to capture all invocations in one queue; a single success destination is sufficient, as failures would either be retried or handled by the DLQ if configured, but the core requirement is to record every invocation.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed