AWS-S3-Lambda-Kraken setup

    • 303 posts
    November 29, 2018 9:25 PM EST

    Hi all 

     

    What I am trying to achieve..

     

    I am using amazons web services S3 bucket as a storage, which works fine. However I'm also trying to create a Lambda function that when a file it passed to storage on the S3 bucket that it first is ran through the Kraken.io API to compress the image size. 

     

    I have had a developer make me the script that will do this and work on Lambda in NodeJS. 

    Where im stuck is the actual setup in regards to image extensions, now in the lambda function you create a trigger and this is for now set as a .png , so when a png file is uploaded the lambda function should do its job and so on. 

     

    What i want to know from those who are familiar with the AWS and hopefully Lambda too is do you know if multi extensions can be added ? 

    • 629 posts
    November 30, 2018 1:48 AM EST

    I assume yes they can be added. You'll need to check AWS first to see what's available.

    • 303 posts
    November 30, 2018 9:47 AM EST

    After reading some it would appear that a function trigger can only have 1 suffix. The good news is you can create multiple triggers for each suffix you would like to use. 

    • 303 posts
    November 30, 2018 10:48 AM EST

    Question 

     

    the images that are stored in the s3, are these served on my wesbite ? 

     


    This post was edited by PeppaPigKilla at November 30, 2018 11:02 AM EST
    • 629 posts
    November 30, 2018 4:26 PM EST

    I think you can control where they're stored. I don't see a setting where you can control if they're stored in multiple locations.