- Newest
- Most votes
- Most comments
The issue you're experiencing with rate exceeded errors for AWS::Lambda::LayerVersion resource deployments via SAM is related to AWS service limits and throttling. When deploying multiple clients in parallel, you're likely hitting the API rate limits for creating Lambda layers.
To mitigate this issue and reduce the likelihood of throttling errors, you can consider the following approaches:
-
Implement exponential backoff and retry logic in your deployment process. This can help handle temporary throttling issues by automatically retrying failed operations with increasing delays between attempts.
-
Stagger your deployments instead of running them all in parallel. You could introduce a slight delay between each client deployment to spread out the API requests over time.
-
Reduce the frequency of layer updates. If possible, update your layers less often or only when necessary, rather than with every deployment.
-
Use a shared layer across multiple clients instead of creating separate layers for each client. This can significantly reduce the number of layer creation operations.
-
Consider using AWS Lambda container images instead of layers for larger dependencies. Container images have a higher size limit (10GB) and may be more suitable for your use case, especially if you have many dependencies.
-
If your layer doesn't change frequently, you could implement a check to see if the layer already exists before attempting to create a new version. This would reduce unnecessary API calls.
-
Reach out to AWS support to request a quota increase for Lambda layer operations if you consistently need to perform a high volume of layer creations.
By implementing one or more of these strategies, you should be able to reduce the occurrence of throttling errors and improve the reliability of your parallel deployments.
Sources
Lambda Package Exceeds 60MB: Solutions for Large Dependencies? | AWS re:Post
AWS::Serverless::LayerVersion - AWS Serverless Application Model
Using AWS SAM with layers - AWS Lambda
Relevant content
asked 5 years ago
asked 3 years ago

Thanks for the suggestions. But, is there any specific reason, why the rate exceeds only on the
AWS::Lambda::LayerVersionresource?