Purpose of this lambda function is to resize the images automatically and stored the resized images in target S3 bucket. Lambda function maintain the aspect ratio internal, if right aspect ratio not mentioned in configuration, then it will automatically detects the aspect ratio and resize accordingly.
In config.json
file update the different image dimensions which you need resize automatically and update target s3 bucket name where you want to store the images.
{
"resizes": [{
"width": 200,
"height": 100
}, {
"width": 300,
"height": 150
}, {
"width": 400,
"height": 200
}],
"target_bucket": "imagemagick-resize.bambeeq.com"
}
- Clone and build this Lambda application and make zip package. To generate zip file command :
make lambda
- Deploy
aws-lambda-image-resizer.zip
from AWS Management Console.
- Clone and build this Lambda application.
- Create lambda function with name of
imageResize
from AWS management Console. Usemake uploadToaws
it will automatically upload to aws.
- Clone and build this Lambda application and make zip package. To generate zip file command :
make lambda
. - Create lambda function from AWS Management Console.
- Depoly lambda zip package via command :
aws lambda update-function-code --function-name [Replace Lambda function name] --zip-file fileb://aws-lambda-image-resizer.zip
If this project help you reduce time to develop, you can donate me :)