AWS Certified Solutions Architect – Professional (SAP-C02) — Question 360
A company has a solution that analyzes weather data from thousands of weather stations. The weather stations send the data over an Amazon API Gateway REST API that has an AWS Lambda function integration. The Lambda function calls a third-party service for data pre-processing. The third-party service gets overloaded and fails the pre-processing, causing a loss of data.
A solutions architect must improve the resiliency of the solution. The solutions architect must ensure that no data is lost and that data can be processed later if failures occur.
What should the solutions architect do to meet these requirements?
Answer options
- A. Create an Amazon Simple Queue Service (Amazon SQS) queue. Configure the queue as the dead-letter queue for the API.
- B. Create two Amazon Simple Queue Service (Amazon SQS) queues: a primary queue and a secondary queue. Configure the secondary queue as the dead-letter queue for the primary queue. Update the API to use a new integration to the primary queue. Configure the Lambda function as the invocation target for the primary queue.
- C. Create two Amazon EventBridge event buses: a primary event bus and a secondary event bus. Update the API to use a new integration to the primary event bus. Configure an EventBridge rule to react to all events on the primary event bus. Specify the Lambda function as the target of the rule. Configure the secondary event bus as the failure destination for the Lambda function.
- D. Create a custom Amazon EventBridge event bus. Configure the event bus as the failure destination for the Lambda function.
Correct answer: B
Explanation
Integrating Amazon API Gateway directly with an Amazon SQS primary queue decouples the ingestion layer from the processing layer, protecting against data loss when the downstream third-party service fails. By configuring a secondary SQS queue as a dead-letter queue (DLQ) for the primary queue, messages that fail to process after multiple Lambda retries are safely preserved for later processing. Other options using EventBridge or incorrect DLQ configurations do not provide this robust queuing and retry mechanism directly out of the box for API Gateway ingestion.