Upload file to Amazon S3 bucket using presigned URL

Amazon API Gateway → AWS Lambda → Amazon S3 Bucket

Amazon API Gateway with AWS Lambda integration to showcase how to upload a file up to 5GB to Amazon S3 bucket using a presigned S3 URL.

Amazon API Gateway receives the HTTP POST request containing the file name to be uploaded
AWS Lambda is triggered by the API Gateway, this java based function generates Amazon S3 presigned URL.
A Java program is used to upload a file to the Amazon S3 bucket using the presigned URL

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-lambda-s3-terraform-java

Deploy

mvn clean packageterraform initterraform apply


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the Amazon S3 bucket content: aws s3 rm s3://{MyS3BucketName} --recursive
Delete the stack: terraform destroy.

Created by:

Jing Xiang Peh

Jing Xiang Peh

I am a Specialist Solutions Architect for Serveless based in Singapore

Follow on LinkedIn