jsonamazon-web-servicesaws-lambdaaws-api-gateway

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?


Solution

  • 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