rodrigopasc / Sizeless

AWS Lambda function built with Node.js for optimizing S3 images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sizeless

AWS Lambda with NodeJS to resize and optimize pictures on S3.


Introduction

This is a script that works by S3 events.

When your bucket receives a new file, this script is going to automatically run to resize and optimize your uploaded picture.


Installation

Dependencies

  • NodeJS & NPM.

Guide

  • You shall need to install Serverless and to do that, open your terminal and run:
$ yarn global add serverless

  • By now, you can clone the source code by running:
$ git clone https://github.com/rodrigopasc/Sizeless

  • You can now install its dependencies.
$ cd Sizeless
$ yarn or npm install

  • You must setup your AWS information. Please create an IAM with Programatic Access and AdministratorAccess permission.
$ serverless config credentials -o --provider aws --key=YOUR_AWS_KEY --secret YOUR_AWS_SECRET

  • Finally you can deploy your brand new AWS Lambda script. Just type and run:
$ yarn deploy or npm run deploy

๐Ÿšจ DO NOT forget to change your bucket name on serverless.yml and to create your prefix subfolder on your bucket as well. ๐Ÿšจ


Enjoy! ๐ŸŽ‰๐ŸŽŠ

About

AWS Lambda function built with Node.js for optimizing S3 images.


Languages

Language:JavaScript 100.0%