
Ultimate access to all questions.
Answer-first summary for fast verification
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.
## Explanation **Correct Answer: C** - 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 correct:** 1. **Lambda@Edge** allows you to run code at CloudFront edge locations, closest to users 2. **Dynamic image resizing** can be performed on-the-fly at the edge without modifying origin infrastructure 3. **Least operational overhead** because: - No need to manage EC2 instances for image processing (Option A) - No need to pre-process and store multiple versions of images - CloudFront handles scaling automatically - Pay-per-use pricing model - Automatic deployment to edge locations **Why other options are incorrect:** **A. Install an external image management library on an EC2 instance:** - Requires managing EC2 instances (operational overhead) - Needs scaling infrastructure to handle thousands of images per second - Higher latency as images need to travel to origin for processing **B. Create a CloudFront origin request policy:** - Origin request policies only modify requests to the origin, they don't process images - Cannot perform image resizing or format conversion - Limited to modifying headers, not content transformation **D. Create a CloudFront response headers policy:** - Response headers policies only modify response headers, not the actual image content - Cannot resize images or change formats - Only affects HTTP headers, not the image data itself **Key AWS Services Used:** - **Lambda@Edge**: Serverless compute at CloudFront edge locations - **CloudFront**: Content delivery network with edge computing capabilities - **S3**: Storage for original images **Best Practice:** Lambda@Edge is the recommended approach for dynamic content transformation at the edge, providing low latency, automatic scaling, and minimal operational overhead.
Author: LeetQuiz Editorial Team
No comments yet.
A social media company runs its application on Amazon EC2 instances behind an Application Load Balancer (ALB). The ALB is the origin for an Amazon CloudFront distribution. The application has more than a billion images stored in an Amazon S3 bucket and processes thousands of images each second. The company wants to resize the images dynamically and serve appropriate formats to clients.
Which solution will meet these requirements with the LEAST operational overhead?
A
Install an external image management library on an EC2 instance. Use the image management library to process the images.
B
Create a CloudFront origin request policy. Use the policy to automatically resize images and to serve the appropriate format based on the User-Agent HTTP header in the request.
C
Use a Lambda@Edge function with an external image management library. Associate the Lambda@Edge function with the CloudFront behaviors that serve the images.
D
Create a CloudFront response headers policy. Use the policy to automatically resize images and to serve the appropriate format based on the User-Agent HTTP header in the request.