: Your Lambda function uses a library like Boto3 (Python) to fetch the object from S3.
: To return a file (like an image), the Lambda function must base64 encode the data and set the isBase64Encoded flag to true in its response. Crucial Technical Requirements Stack Overflow How to upload large file using AWS Gateway and S3 proxy
Use this method if you need to perform authentication, logging, or dynamic file selection before the download.
To download files from Amazon S3 via API Gateway, you can choose between a for simplicity or a Lambda integration for custom logic. However, API Gateway has a strict 10MB payload limit , making it unsuitable for large files. Core Methods for S3 Downloads 1. API Gateway as a Direct S3 Proxy (No Lambda)
: You must create an IAM role that allows the ://amazonaws.com service to perform s3:GetObject on your target bucket.
: Use path parameters (e.g., /{bucket}/{key} ) and map them to the S3 bucket and object key in the Integration Request settings. 2. Lambda Proxy Integration
: You configure an "AWS Service" integration type in API Gateway, pointing to the GetObject action in S3.
This is the most cost-effective method for small, static files. API Gateway communicates directly with the S3 API.