Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Latest commit

 

History

History
19 lines (13 loc) · 877 Bytes

README.md

File metadata and controls

19 lines (13 loc) · 877 Bytes

Static Website: Image optimization

Works together with https://templates.cloudonaut.io/en/stable/static-website/

Optimizes .png, .jpg, and .jpeg images and enerates .webp images at the edge.

Installation Guide

Requires Node.js v10!

cd lambda-src
docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm ci --production
cd ..
aws --region us-east-1 cloudformation package --s3-bucket $BUCKET_NAME --template-file lambdaedge-img-optimize.yaml --output-template-file .lambdaedge-img-optimize.yaml
aws --region us-east-1 cloudformation deploy --template-file .lambdaedge-img-optimize.yaml --stack-name lambdaedge-img-optimize --capabilities CAPABILITY_IAM

Copy the OriginRequestLambdaEdgeFunctionVersionARN output of the stack and use it with static-website/static-website.