AWS Certified Developer – Associate — Question 300

A developer migrated a legacy application to an AWS Lambda function. The function uses a third-party service to pull data with a series of API calls at the end of each month. The function then processes the data to generate the monthly reports. The function has been working with no issues so far.

The third-party service recently issued a restriction to allow a fixed number of API calls each minute and each day. If the API calls exceed the limit for each minute or each day, then the service will produce errors. The API also provides the minute limit and daily limit in the response header. This restriction might extend the overall process to multiple days because the process is consuming more API calls than the available limit.

What is the MOST operationally efficient way to refactor the serverless application to accommodate this change?

Answer options

Correct answer: B

Explanation

Using an Amazon SQS queue to buffer the API requests allows the Lambda function to poll and process messages at a controlled rate, ensuring the third-party service's rate limits are not exceeded. AWS Step Functions (Option A) is not ideal for this scenario as holding state over multiple days would introduce unnecessary complexity and cost. CloudWatch alarms (Option C) and S3 event notifications (Option D) do not provide the granular flow control needed to throttle the API consumption rate over extended periods.