Skip to content

aws Lambda Function for creating thumbnails of images uploaded to a s3 bucket

License

Notifications You must be signed in to change notification settings

rahool/aws-lambda-thumbnailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-lambda-thumbnailer

aws Lambda Function for creating thumbnails of images uploaded to a s3 bucket

Uses sharp image processing module to resize images.

$ npm install
$ zip -r thumbnailer.zip index.js node_modules/ package.json package-lock.json

Set up S3

Create a folder named 'thumbnails' in the bucket where you will be uploading images. S3 bucket and the lambda function should be in the same region.

Set up Lambda

  1. Create a new Lambda from aws console
  2. Goto Function code of the newly created Lambda and upload the thumbnailer.zip file

Screenshot

  1. Create a new Role in IAM and attach AWSLambdaExecute policy

Screenshot

  1. Select this role as your Lambda's Execution role

Screenshot

  1. If the images are pretty large you can increase the timeout value in Lambda.

Screenshot

Event notification

In you S3 bucket properties, add an event notification to notify Lambda whenever some file is uploaded to your bucket.

Screenshot

About

aws Lambda Function for creating thumbnails of images uploaded to a s3 bucket

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published