- Newest
- Most votes
- Most comments
Hi Jackson,
Both Labmda and API payload size is hard limit and cannot be increased.
-
If you want to upload file, you can consider using S3 pre-signed URL [1] , which allows client to directly upload or download object with payload greater than 10 MB. You can integrate API Gateway with Lambda function, such that lambda code will generate S3 pre-signed URL for API clients. API clients can use pre-signed URL to directly send and receive larger payload object. Here is a third-party documentation [2], with example implementation, as a reference.
-
Alternatively, you can upload zipped file as the payload to the API gateway but that should be within the limit of 10 MB. However, kindly note that when a client sends a compressed payload along with a supported Content-Encoding header, API Gateway attempts to decompress the payload before forwarding it to the integration [3]. This is applicable even when ContentEncoding is not enabled at API Gateway. If the decompressed payload size is greater than 10MB it leads to a “413 Request Too Long” error from API Gateway.
[1] https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
[2] https://sookocheff.com/post/api/uploading-large-payloads-through-api-gateway/
In such cases I have bookmarked this page with a few good patterns: https://aws.amazon.com/blogs/compute/patterns-for-building-an-api-to-upload-files-to-amazon-s3/
Relevant content
- Accepted Answerasked 2 years ago
- Accepted Answerasked 5 months ago
- Accepted Answerasked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 13 days ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago