A metadata service collects information from on-premises apps and is accessed by consumer devices (TVs, internet radios). Older devices cannot support certain HTTP response headers; your on-premises load balancer currently strips those headers for requests identified by User-Agent. The application functions have been migrated to AWS Lambda and you want a serverless solution that still supports legacy devices by removing problematic headers. Which solution meets these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a CloudFront distribution for the metadata service with an Application Load Balancer (ALB) as the origin. Configure the ALB to invoke the correct Lambda function for each request. Create a CloudFront Function to remove the problematic headers from responses based on the request User-Agent..
Why this is the answer
The correct solution leverages CloudFront Functions for efficient, low-latency header manipulation at the edge. CloudFront Functions execute JavaScript code at CloudFront edge locations, allowing for quick modifications to requests or responses, such as removing headers based on the User-Agent, without incurring the latency of a full Lambda@Edge invocation. The ALB routes requests to the appropriate Lambda functions, providing the serverless application backend. Incorrect options: API Gateway REST API: Modifying default gateway responses in API Gateway is for error responses, not for dynamically stripping headers from successful application responses based on User-Agent. API Gateway HTTP API: While HTTP APIs are performant, response mapping templates are primarily for transforming the response body, not for conditionally removing specific headers based on request attributes like User-Agent. Lambda@Edge: While Lambda@Edge can modify headers, CloudFront Functions are a more cost-effective and lower-latency solution for simple header manipulation tasks, making them a better fit for this specific requirement.
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