3

Currently, I've been receiving this error in Bitbucket.

The pipeline sequence is that

  • serverless is deployed (./node_modules/.bin/serverless deploy -s devme)
  • then run a javascript that would update the API gateway (to create API gateway models).

What could be the problem?

What are the reasons why this exception would occur?

Steven
  • 821
  • 1
  • 10
  • 24
  • Are you exceeding the [limits](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html#api-gateway-limits) for API creation (bottom table on the page)? – Michael - sqlbot Jan 04 '18 at 12:23

2 Answers2

0

The 429 - Too Many Requests Exception means you are getting throttled by API Gateway. You can only make so many requests per second. Anymore than the allowed will result in the 429.

The API Gateway limits can be found here: https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html#api-gateway-limits

Mark Mercurio
  • 983
  • 6
  • 9
0

I'm using CDK instead of Serverless, but the way I solved it was basically spltting my CloudFormtation stack into multiple smaller stacks. I ended up with this:

  • ApiGatewayStack - contains the API gateway configuration
  • ApiModelsFirstStack - depends on ApiGatewayStack and contains models
  • ApiModelsSecondStack - depends on ApiGatewayStack and contains models
  • BackEndStack - contains everything else for my back-end, API endpoints, S3 buckets, WAF etc.

Another cool thing that worked for me in a similar situation (it was AppSync, instead of API Gateway, but the same type of problem) ,serverless-plugin-split-stacks, which should do this automagically for you.

Simeon Borisov
  • 417
  • 2
  • 6