Image Resize Setup

Install and configure imageResize to serve and cache thumbnails generated from the orginals images.

Download Stack

git clone https://github.com/yapawa/imageResize.git
cd imageResize
nvm use
npm ci
cp -a stages/production.sample.yml stages/production.yml

Configure Stack

Edit stages/production.yml:

profile: AWSProfileName
region: AWSRegion
suffix: "" # Or "-stage" for a multi stage deploy
cacheBucket: cacheBucketName
srcBucket: <aws_user_files_s3_bucket>
srcPrefix: public # Important
domainName: img.gallery.example.com
hostedZoneId: hostedZoneId
certificateArn: arn:aws:acm:us-east-1:yyyyyyyy:certificate/zzzzzzz
lambda:
  memorySize: 1024
  timeout: 30
  logRetention: "30"
  • cacheBucketName: Bucket name of your choice
  • aws_user_files_s3_bucket: Bucket created by Albums Manager

Deploy

npm run deploy

This will take some time, mainly due to the creation of the Cloudfront Distribution.

What is created ?

  • HTTP API
  • S3 Bucket for cached images storage
  • Lambda functions:
    • Image resizer using Sharp

Next

Last modified April 21, 2020: Add installation doc (5595b5e)