Skip to content

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.

Notifications You must be signed in to change notification settings

nikitadev-yt/image-resizer-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published