Skip to content

edbentinck/lambda-edge-image-resizing

Repository files navigation

lambda-edge-image-resizing

This is a modified version of Resizing Images with Amazon CloudFront & Lambda@Edge | AWS CDN Blog for my own use.

Things that differ from the blog post:

Dockerfile:

  • Updated versions of nvm and node (as of February, 2020).
  • Uses gzip

Build Steps:

  1. Compile the lamdba functions using docker: sh docker_build.sh
  2. Package up the functions into zip files: sh package_build.sh
  3. Upload zips to S3, as instructed in the blog post (Step 1, point 7)

Testing Locally (macOS):

NB: For detailed instructions on the tools and setup involved in this section, please refer to the full AWS SAM CLI documentation

In order to test in your development environment on macOS, you will need to do a bit of setting up first. Follow these instructions to install the AWS SAM CLI. In summary, you will require the following:

  1. An AWS account
  2. Set up an IAM user with administrator permissions
  3. Installed Docker
  4. Installed Homebrew
  5. Installed the AWS SAM CLI via Homebrew

At this stage you should confirm that you have the AWS SAM CLI installed: sam --version.

To make full use of the AWS SAM CLI you must also set up your AWS credentials on your development machine.


Once you have completed the setup of the AWS SAM CLI, you can debug Node.js functions locally from within VS Code.

Since the documentation above isn't the clearest, you can also check out the following video about debugging Lambda functions from within VS Code. Whilst the actions that they perform in the video aren't exactly the same, it will give you an idea of the sorts of functionality that the AWS Toolkit VS Code extension provides.

About

Resizing Images with Amazon CloudFront & Lambda@Edge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published