Today I tested the amazing Lambda and I was able to automaticly process images, generating thumbnails by just copying an image into a S3 bucket.
I followed the Walkthrough at
http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser-create-test-function-create-function.html
But had few steps to do not listed there:
1) Install node.js on my local linux, and make a zip file with prereq, using ubuntu I did
sudo apt-get install npm
mkdir example && cd example
npm install async gm
# Then I had:
node_modules/
async/
gm/
#Saved the code(step 3) into index.js
zip -v -r npm1.zip *
2) Create two buckets, example images_test, images_testresized
3)Upload ZIP
Lamda > Function >Code (UPLOAD a .ZIP file)
upload
4) Upload a png to S3, check the resized S3 bucket, Cloud watch integrated monitor, and the
detailed log about the operation.
lambda_logs
lambda_perf
There is a github project with a more complex image resize, but for me it didnt work.
At this moment we have a complex EC2 + SQS + AS solution to process and convert images that could all be done with a simples JS and Lambda to achive the same results.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *

*