Resizing images uploaded to Amazon S3 with AWS Lambda (Python)

Amazon S3 → AWS Lambda → Amazon S3

Create an AWS Lambda function that resizes images uploaded to Amazon S3.

A Lambda function consumes events from an Amazon S3 bucket. The Lambda code checks the uploaded file is an image, creates a thumbnail version of the image, then uploads the thumbnail to the destination bucket.
This pattern deploys a Lambda function and two S3 buckets.

< Back to all patterns
AWS Top Pick

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/s3-lambda-resizing-python

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the application: sam delete.

Additional resources

Created by:

Seshu Brahma

Seshu Brahma

AWS Lambda Software Dev Engineer

Follow on LinkedIn