- Newest
- Most votes
- Most comments
The HTTP 429 error you're encountering indicates that you're being rate limited when CodeBuild is trying to access your CodeCommit repository. This is likely happening because the Lambda function is potentially triggering multiple builds in quick succession, causing you to hit API rate limits.
To address this issue, you can try the following approaches:
-
Implement exponential backoff and retry logic in your Lambda function. This will help spread out the requests and reduce the likelihood of hitting rate limits.
-
If possible, batch your build requests instead of triggering them individually. This can help reduce the number of API calls made in a short period.
-
Consider using AWS Step Functions to orchestrate your builds. Step Functions can help manage the flow of your builds and inherently provides some spacing between executions.
-
Review your CodeBuild project settings to ensure you're not unnecessarily fetching large amounts of data or history that could be contributing to the rate limiting.
-
If the issue persists, you may need to contact AWS support to request an increase in your API rate limits for CodeCommit or CodeBuild.
Regarding your permissions, the policy you've provided looks correct for starting builds and pulling from CodeCommit. However, you might want to consider making the resource ARNs more specific to your particular projects and repositories for better security practices.
Remember, when triggering builds programmatically, it's important to implement proper error handling and retry mechanisms to deal with transient issues like rate limiting.
Sources
CLIENT_ERROR: Submodule error authorization failed | AWS re:Post
Manage AWS CodeBuild builds with Step Functions - AWS Step Functions
AWSCodeBuildDeveloperAccess - AWS Managed Policy
Relevant content
asked a year ago
