Request processing workflow - Dynamic Image Transformation for Amazon CloudFront

Request processing workflow

Lambda processing steps:

  1. API Gateway receives image transformation request

  2. Request parameters are validated and parsed

  3. Lambda function is invoked with transformation parameters

  4. Original image is fetched from S3 bucket

  5. Sharp library applies transformations (resize, crop, format conversion, etc.)

  6. Processed image is returned through API Gateway

  7. CloudFront caches the processed image for future requests

Supported transformations: - Resize with various fit options (cover, contain, fill, inside, outside) - Crop with precise coordinates or smart cropping using Amazon Rekognition - Format conversion ("jpg", "jpeg", "heic", "png", "raw", "tiff", "webp", "gif", "avif") - Quality optimization and compression - Rotation and flip operations - Watermarking and overlay effects - Content moderation using Amazon Rekognition