Skip to content

AWS Lambda

Paninee K edited this page Feb 15, 2020 · 1 revision
  • AWS Lambda function optimize-image is being used to optimize and encode images to GZip.
  • The script we uploaded to AWS Lambda is script/lambda-image-optimize.js.
  • To test the script, we simply run node lambda-image-optimize.js.
    • set AWS.S3 config to a bucket we want to test with
    • set a hard-coded file name to test the resizing, re-encoding and S3 upload.
    • call handler() method
  • To deploy new changes to AWS Lambda, we need to zip the lambda-image-optimize.js file along with node_module/, then upload it to our optimize-image function in AWS Lambda.
  • We can monitor and debug the function in AWS CloudWatch Logs
Clone this wiki locally