aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

sam sync: AwsSamAutoDependencyLayer causing Lambda Throttling

Open bgeshk opened this issue 4 years ago • 2 comments

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 --watch

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)

  1. OS: Mac
  2. sam --version: 1.52.0
  3. AWS region: us-east-2

Add --debug flag to command you are running

bgeshk avatar Sep 09 '22 21:09 bgeshk

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!

lucashuy avatar Sep 09 '22 22:09 lucashuy

Closing due to inactivity. Feel free to re-open if your issue isn't resolved.

moelasmar avatar Nov 12 '22 23:11 moelasmar