Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API Gateway: JSON 5+ MB Gives error "413, Request Too Long"

I have sample json which is more than 5MB,

When not using lambda integration & try to do post request

413 Request Too Long

If I use lambda integration it gives

502 Internal server error

Request does not reach to my lambda function

In response headers I'm getting following error:

X-Cache: Error from cloudfront

If I use mock service it works & gives 200 response.

As per Api documentation it supports max 10MB.

I want to get this json in my request.

Any solutions?

like image 392
Jagdish Idhate Avatar asked Mar 09 '23 07:03

Jagdish Idhate


1 Answers

I think what you are seeing is not the limit of the API Gateway, but rather the request limit of the Lambda function. Those have a limit of 6MB for the whole input. So depending on you input mapping 5+MB payload could result in a larger payload for the Lambda request.

AWS Lambda Limits

like image 130
jens walter Avatar answered Mar 17 '23 03:03

jens walter