Skip to content

RequestLimitExceeded error when creating lambda functions inside VPC #3339

@zacharynevin

Description

@zacharynevin

This is a Bug Report

Description

  • What went wrong?
    I have around 40 lambda functions in my serverless file. When I do serverless deploy without a VPC configuration, it deploys fine.

However, when I add a VPC configuration like this:

vpc:
  securityGroupIds:
    - ***
  subnetIds:
    - ***

I have a few of the functions create and then the CF deployment fails because of the following error:

  Serverless Error ---------------------------------------
 
     An error occurred while provisioning your stack: MyLambdaFunction
     - Your request has been throttled by EC2, please make
     sure you have enough API rate limit. EC2 Error Code:
     RequestLimitExceeded. EC2 Error Message: Request limit
     exceeded..
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
 
  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       7.6.0
     Serverless Version: 1.8.0

After filing an AWS support request, this error appears because there is a hard limit on the create function. This can be solved in one of two ways:

  • Split the serverless.yaml file into smaller pieces.
  • Add the DependsOn parameter to each lambda function.

Personally I like the 2nd option because I won't need to modify my existing serverless.yaml file. However, I could not find anything in the Serverless documentation or the Github issues list that indicates there is an optional DependsOn property for lambda functions, so that I can delay the creation of a lambda function until another one has finished creating.

If this exists, can you let me know how it works? If it does not exist, is there is a package or a feature proposal for this?

Thanks so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions