DOP-C02 Question 189
Single answerYour team is managing a CI/CD pipeline for a serverless application using AWS Lambda. The pipeline uses AWS CodePipeline for orchestration and AWS CodeBuild for running unit tests. Recently, the pipeline has started failing frequently during the build phase. Upon investigation, the logs show intermittent 'Rate Exceeded' errors when CodeBuild attempts to access AWS Lambda APIs. How can you resolve this issue while maintaining best practices?
- A
Increase the throttling limits for the AWS Lambda API by contacting AWS Support.
- B
Implement exponential backoff and retry logic for the CodeBuild project when accessing AWS Lambda APIs.
- C
Add a step in the CodePipeline pipeline to pre-fetch AWS Lambda tokens before the build phase.
- D
Use an AWS Service Quotas request to increase the API request limit for AWS Lambda.
- E
Split the build process into smaller steps and stagger API requests to AWS Lambda.
Show answer and explanation
Correct answer: B
Explanation
Rate limiting errors occur when the number of API requests exceeds the allowed threshold for a service. AWS recommends implementing exponential backoff and retry logic to manage throttling errors effectively. This approach ensures that requests are retried with increasing delays, reducing the likelihood of hitting the rate limit repeatedly. Other options, such as increasing limits via Service Quotas, may not be feasible or immediate and do not align with best practices.
- A. Incorrect.
AWS does not allow direct manual changes to throttling limits for a service. Throttling limits are managed automatically or adjusted via Service Quotas.
- B. Correct.
Exponential backoff and retry logic is a recommended best practice to handle throttling errors in AWS services. This ensures API requests are retried with delays, reducing the risk of hitting rate limits.
- C. Incorrect.
Fetching AWS Lambda tokens beforehand does not address the root issue of rate limiting. This step is unnecessary and would not resolve the problem in this scenario.
- D. Incorrect.
While Service Quotas can be used to request higher limits for some services, this is not a guaranteed or immediate solution and does not align with best practices for handling throttling errors.
- E. Incorrect.
Splitting the build process into smaller steps may reduce contention, but it is not a scalable or efficient solution for handling throttling issues.