A social media company runs its app on Amazon EC2 instances behind an ALB. The ALB is the origin for a CloudFront distribution. The app stores more than a billion images in an S3 bucket and processes thousands of images per second. The company wants to dynamically resize images and serve appropriate formats to clients. Which solution meets these requirements with the LEAST operational overhead?
Choose an answer
Tap an option to check your answer.
Correct answer: Use a Lambda@Edge function with an external image management library. Associate the Lambda@Edge function with the CloudFront behaviors that serve the images..
Why this is the answer
Using a Lambda@Edge function associated with CloudFront behaviors is the most efficient solution. Lambda@Edge allows code to run at AWS edge locations, close to users, reducing latency. It can intercept requests and dynamically resize images on the fly before they are served, minimizing operational overhead as there are no servers to manage. The function can integrate with an image management library to handle resizing and format conversion based on request parameters. Installing an external image management library on an EC2 instance would require managing the EC2 instances, scaling them, and integrating them with the existing architecture, increasing operational overhead. CloudFront origin request policies and response headers policies are used for modifying request or response headers and caching behavior, not for dynamic image processing like resizing. They lack the computational capability to execute image manipulation logic.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed