AWS API Gateway: Error 429 Too many requests

napcoder picture napcoder · Mar 14, 2016 · Viewed 11.7k times · Source

I'm trying to create a backend system with AWS API Gateway and Lambda.
In the past days I created a PUT method for a new API resource, with an API Key as a simple first security step. The PUT method invoke a Lambda function on AWS.
Then I deployed this API to a "prod" stage for some tests.

In the first days everything were working well as expected: I created a call to the API with postman and I received all the data I was expecting. But a couple of days ago I started to receive always the 429 "Too many requests" response. I created also a new stage, but nothing changed: also the new stage, with the same version or with newer version, is getting always the same error.
The API is not reaching any limit, because they are called 4 or 5 times per day, not per second (checked on CloudWatch). There is no cycle, it is only a single invocation. I suppose there is no error on the lambda side, because if I test the API in the AWS API Gateway console I get no error (and the lambda was working well in the past, no new changes from that version). The error only shows when I use an external client to test my api (in my case it is Postman).

Can anyone help to solve this problem?

UPDATE: I've just created a POST method on the same resource, with the same parameters and the same lambda. It is working. I wonder if the problem is related to the PUT methods in general or if within 2 days also my POST method will be affected by the same problem.

Answer

Benjamin Crouzier picture Benjamin Crouzier · Mar 23, 2016

I had the same problem. I deleted and recreated the deployment. It did work in my case.