AWS API GW with POST request payload more than 10MB

0

The client-side needs to send a POST request with a payload exceeding 10MB, but the AWS API GW I'm working with has a strict 10MB limit(HTTP API quotas). Considering this constraint, is there any other way to work around this problem?

2回答
1

Hi Jackson,

Both Labmda and API payload size is hard limit and cannot be increased.

  1. 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.

  2. 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/

[3] https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-enable-compression.html#api-gateway-enable-compression-console

profile picture
回答済み 4ヶ月前
0

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/

profile picture
エキスパート
回答済み 4ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ