
Answer-first summary for fast verification
Answer: Set up an Amazon CloudFront distribution for the metadata service, an Application Load Balancer (ALB), and configure CloudFront to forward requests to the ALB. Have the ALB invoke the appropriate Lambda function for each request type. Use a CloudFront function to strip the problematic headers based on the User-Agent header.
The correct answer is A. The company needs a solution that strips unsupported headers based on the User-Agent header before sending responses to older devices. A CloudFront distribution in front of an Application Load Balancer (ALB) is a suitable choice because CloudFront provides edge caching and distribution benefits. The ALB can route requests to the appropriate AWS Lambda functions. The crucial part is to remove the problematic headers, which can be efficiently handled by using a CloudFront function to inspect and modify headers much faster and lighter than Lambda@Edge. CloudFront functions are specifically designed for lightweight operations like this, making them a more optimized and suitable choice for this scenario.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company hosts applications accessed by consumer devices like TVs and internet radios. Some older devices cannot handle certain HTTP headers and show errors when these headers are present in responses. The company currently uses an on-premises load balancer to strip these headers from responses sent to older devices, identified by their User-Agent headers. The company plans to migrate this service to AWS using serverless technologies and needs to ensure continued support for older devices. The applications have already been migrated to AWS Lambda functions. Which AWS solution should the company implement to meet these requirements?
A
Set up an Amazon CloudFront distribution for the metadata service, an Application Load Balancer (ALB), and configure CloudFront to forward requests to the ALB. Have the ALB invoke the appropriate Lambda function for each request type. Use a CloudFront function to strip the problematic headers based on the User-Agent header.
B
Create an Amazon API Gateway REST API for the metadata service, configure it to invoke the appropriate Lambda function for each request type, and modify the default gateway responses to strip the problematic headers based on the User-Agent header.
C
Develop an Amazon API Gateway HTTP API for the metadata service, configure it to invoke the appropriate Lambda function for each request type, and create a response mapping template to strip the problematic headers based on the User-Agent header. Associate this mapping with the HTTP API.
D
Establish an Amazon CloudFront distribution for the metadata service, an Application Load Balancer (ALB), and configure CloudFront to forward requests to the ALB. Have the ALB invoke the appropriate Lambda function for each request type. Implement a Lambda@Edge function to strip the problematic headers in response to viewer requests based on the User-Agent header.