Lambda Function Invocation Payload Size limit

0

Problem Statement:

We are currently using an API Gateway and Lambda function to convert a SOAP API to REST. However, we encountered an issue due to AWS Lambda's invocation payload size limit, which prevents the Lambda function from being triggered when a SOAP request contains a document larger than 6 MB. We would like to handle this challenge entirely on the AWS side without requiring any changes on the client side. Specifically, we want to use a combination of API Gateway, Lambda, and S3 to manage and process larger payloads seamlessly.

Current setup We have exposed a single api gateway endpoint for the client and internally, on lambda side we're doing soap to rest conversion, and sending the request to soap service. Once the SOAP service sends the response to lambda, lambda send the response back to api gateway and then api gateway sends the response to client.

Expectation We don't want to the endpoint exposed or don't want the client to make any changes on their end. And want to find a solution on aws side itself.

1 Answer
0

Unfortunately, this is not possible without changes on the client side. When API Gateway receives a request, it can only do one thing. So it can't, for instance, store the payload in S3 and invoke the function. Also, Lambda has a payload limit of 6MB. API Gateway has a limit of 10MB, so potentially, even if there was a solution in Lambda, you would be blocked by the limit in API Gateway.

What we usually recommend is for the client to upload the payload to S3 and then pass the object name, but this requires a change in the client.

If this is not possible, you should probably go with Fargate containers behind an Application Load Balancer.

profile pictureAWS
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • Thanks for the Response @Uri . Agreed! However, is there any alternative solution or service that could work for my use case? My payload size won't exceed the apigateway limit, I’d prefer not to make any changes on the client side, particularly to the API Gateway endpoint. The entry point must remain as API Gateway.

    I’ve tried integrating S3 with my API Gateway to trigger a Lambda function via event notifications, but I wasn’t able to achieve a synchronous flow. I need to send the Lambda response (success or failure) back to the client as part of the same API Gateway invocation. Is this possible? Or could I use Step Functions to orchestrate this flow in a single, synchronous call?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions