Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Resizer Lambda

This Lambda will be invoked when a file is uploaded to a particular bucket. It will fetch the file that was added, resize it, and store the output in a different bucket.

Run Locally

Clone the project

  git clone https://github.com/OneLightWebDev/image-resizer-lambda.git

Install Dependencies

# Required options if on mac
npm install --arch=x64 --platform=linux --target=16x sharp

Environment Variables

Remember set the DEST_BUCKET in your Lambda's "Configuration" tab. To do this, open your Lambda in the AWS Console, select the "Configuration" tab, then click "Environment variables"

DEST_BUCKET=thumbnails-bucket-name

Deployment

npm run package

Running the command above will zip your source code and dependencies. The zip can then be uploaded to your Lambda.

About

This lambda is set up with an S3 trigger. When a file is uploaded to a bucket, the lambda will fetch it, resize, and store it in another bucket.

Resources

Stars

29 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages