What does this AWS Solutions Implementation do?

The Serverless Image Handler solution provides a highly available serverless architecture that initiates cost-effective image processing in the AWS Cloud. The image handling architecture uses Sharp, the open source image processing software, and is optimized for dynamic image manipulation. This solution uses Amazon CloudFront for global content delivery and Amazon Simple Storage Service (Amazon S3) for reliable and durable cloud storage at a low cost.

The latest version of this solution uses the most up-to-date Node.js runtime. Version 4.0 and earlier versions use the Node.js 8.10 runtime, which reached end-of-life on December 31, 2019. To upgrade to version 5.x, you must update your AWS CloudFormation stack. For more information, refer to the implementation guide.

Content Moderation

Detect and blur inappropriate images using Amazon Rekognition.

Smart cropping

Crop images using the facial recognition capabilities of Amazon Rekognition.

Interactive web interface

Deploy a simple web interface where you can interact directly with your image handler API endpoint using image files that already exist in your account.

AWS Solutions Implementation overview

AWS offers a simple solution that automatically deploys and configures a serverless architecture that is optimized for dynamic image manipulation. The diagram below presents the Serverless Image Handler architecture you can deploy in minutes using the solution's implementation guide and accompanying AWS CloudFormation template.

Serverless Image Handler | Architecture Diagram
 Click to enlarge

Serverless Image Handler architecture

  • The AWS CloudFormation template deploys an Amazon CloudFront distribution, Amazon API Gateway, and an AWS Lambda function.
  • Amazon CloudFront provides a caching layer to reduce the cost of image processing and the latency of subsequent image delivery.
  • API Gateway provides endpoint resources and initiates the Lambda function.
  • The Lambda function retrieves the image from a customer’s Amazon S3 bucket and uses Sharp to return a modified version of the image to the API Gateway.
  • The solution generates a CloudFront domain name that provides cached access to the image handler API.

If you activate the image URL signature feature, the Lambda function retrieves the secret value from your existing AWS Secrets Manager secret to validate the signature. If you use the smart crop or content moderation features, the AWS Lambda function calls Amazon Rekognition to analyze your image and returns the results.

Serverless Image Handler

Version 5.2.0
Last updated: 01/2021
Author: AWS

Estimated deployment time: 15 min

Use the button below to sign up for updates to this Solutions Implementation via email.
Did this Solutions Implementation help you?
Provide feedback 
Solving with AWS Solutions: Serverless Image Handler
AWS Architecture Blog
Fast and Cost-Effective Image Manipulation with Serverless Image Handler
As a modern company, you most likely have both a web-based and mobile app platform to provide content to customers who view it on a range of devices. This means you need to store multiple versions of images, depending on the device. The resulting image management can be a headache as it can be expensive and cumbersome to manage.
Serverless Image Handler (SIH) is an AWS Solution Implementation you use to store a single version of every image featured in your content, while dynamically delivering different versions at runtime based on your end user’s device.
Read the full blog post 
Build icon
Deploy a Solution yourself

Browse our library of AWS Solutions Implementations to get answers to common architectural problems.

Learn more 
Find an APN partner
Find an APN Partner

Find AWS certified consulting and technology partners to help you get started.

Learn more 
Explore icon
Explore Solutions Consulting Offers

Browse our portfolio of Consulting Offers to get AWS-vetted help with solution deployment.

Learn more