
Answer-first summary for fast verification
Answer: Configure an Amazon Simple Queue Service (Amazon SQS) queue as the on-failure destination. Modify the Lambda function to process messages in the queue.
## Explanation **Correct Answer: D** **Why Option D is correct:** 1. **Dead Letter Queue (DLQ) Pattern**: Configuring an SQS queue as an on-failure destination (also known as a Dead Letter Queue or DLQ) is a standard AWS best practice for handling failed Lambda invocations. 2. **Message Persistence**: When the Lambda function fails due to network connectivity issues, the message (notification) is automatically sent to the SQS queue, which provides durable message storage. 3. **Retry Mechanism**: The Lambda function can be modified to periodically poll and process messages from the SQS queue, ensuring eventual processing of all notifications. 4. **Decoupling**: This approach decouples the notification reception (SNS) from the processing (Lambda), providing a buffer that can handle temporary failures. **Why other options are incorrect:** **Option A**: Deploying Lambda across multiple Availability Zones doesn't address the core issue. Lambda functions are already highly available and automatically run across multiple AZs in a region. The problem is with message processing failures, not Lambda availability. **Option B**: Increasing CPU and memory allocations won't solve network connectivity issues. Network problems are external to the Lambda function's compute resources. **Option C**: While SNS does have retry capabilities, increasing retries and wait times is not the most robust solution. SNS retries are limited in duration (up to 24 hours), and this approach doesn't provide persistent storage for failed messages. If the network issue persists beyond the retry period, messages will still be lost. **Key AWS Services Relationship:** - **SNS → Lambda**: Direct integration where SNS can invoke Lambda functions - **SNS → SQS → Lambda**: More resilient pattern where SNS publishes to SQS queue, and Lambda polls from the queue - **Lambda DLQ**: Lambda can be configured with SQS or SNS as a DLQ destination for failed invocations **Best Practice Implementation:** 1. Create an SQS queue as a DLQ for the Lambda function 2. Configure the Lambda function's `on-failure` destination to point to the SQS queue 3. Modify the Lambda function to include logic to process messages from the DLQ 4. Optionally, set up CloudWatch alarms to monitor the DLQ depth 5. Consider implementing exponential backoff retry logic in the Lambda function for processing DLQ messages
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company has a data ingestion workflow that includes the following components:
The ingestion workflow occasionally fails because of network connectivity issues. When failure occurs, the corresponding data is not ingested unless the company manually reruns the job.
What should a solutions architect do to ensure that all notifications are eventually processed?
A
Configure the Lambda function for deployment across multiple Availability Zones.
B
Modify the Lambda function's configuration to increase the CPU and memory allocations for the function.
C
Configure the SNS topic's retry strategy to increase both the number of retries and the wait time between retries.
D
Configure an Amazon Simple Queue Service (Amazon SQS) queue as the on-failure destination. Modify the Lambda function to process messages in the queue.