sam sync: AwsSamAutoDependencyLayer causing Lambda Throttling
Description:
Running into an issue when using sam sync to create a CloudFormation stack. The AwsSamAutoDependencyLayer Nested Stack is building a bunch of dependency layers for each lambda concurrently, which is yielding the below error to get reported in CloudFormation:
Rate exceeded (Service: AWSLambdaInternal;)
Steps to reproduce:
Running sam sync --stack-name <stack_name> -t <template_file_name> --region
Observed result:
Lambda throttling error message
Expected result:
Lambda throttling does not occur when using sam sync
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Mac
sam --version:1.52.0- AWS region:
us-east-2
Add --debug flag to command you are running
Hi, thanks for opening this issue! You can try disabling the auto dependency label by include the command line flag: --no-dependency-layer, this may help with the throttling issues you are seeing. Note that by disabling the dependency layer, the benefits to layers are loss as a result. Additionally, can you also update to SAM CLI version 1.56 (the latest version) to see if it is reproducible there?
Cloudformation is in charge of creating and deploying Lambdas, including their layers, so the rate limit isn't something SAM CLI can directly control.
If you had any other feedback about sam sync, we would greatly appreciate it!
Closing due to inactivity. Feel free to re-open if your issue isn't resolved.