2
votes

I understand that by design, API Gateway maps 429 errors from Lambda to 500 responses. Is there a way to map 429 to something else like 202? I tried to create an integration response mapping from this regex: .* which should map virtually everything to my defined status code, but i still receive 500 errors, from the API gateway.

2

2 Answers

3
votes

Pasting my response from the AWS Forum post:

There is no way to map Lambda's 429 to any status code. It will always be considered as 500. Curious to know, why do you want to map 429 to 202 (which means 'Accepted')?

0
votes

Lambda 429 now maps to the INTEGRATION_FAILURE API Gateway response, so you can map it to any code you want, but keep in mind that will make any other integration error return that code as well. See https://forums.aws.amazon.com/thread.jspa?threadID=309901