Q17 — AWS SAP-C02 Ch.2
Question 17 of 75 | ← Chapter 2
Q167. A company uses a service to collect metadata from applications that the company hosts on premises. Consumer devices such as TVs and internet radios access the applications. Many older devices do not support certain HTTP headers and exhibit errors when these headers are present in responses. The company has configured an on-premises load balancer to remove the unsupported headers from responses sent to older devices, which the company identified by the User-Agent headers. The company wants to migrate the service to AWS, adopt serverless technologies. and retain the ability to support the older devices. The company has already migrated the applications into a set of AWS Lambda functions.Which solution will meet these requirements?
- A. Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a CloudFront function to remove the problematic headers based on the value of the User-Agent header
- B. Create an Amazon API Gateway REST API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Modify the default gateway responses to remove the problematic headers based on the value of the User-Agent header
- C. Create an Amazon API Gateway HTTP API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Create a response mapping template to remove the problematic headers based on the value of the User-Agent. Associate the response data mapping with the HTTP API
- D. Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a Lambda@Edge function that will remove the problematic headers in response to viewer requests based on the value of the User-Agent header ✓
Correct Answer: D. Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a Lambda@Edge function that will remove the problematic headers in response to viewer requests based on the value of the User-Agent header
Explanation
To meet the requirement of adopting serverless technologies while retaining the ability to support older devices, a solution that includes Amazon CloudFront and Lambda@Edge can be used. Option D is correct since it involves creating an Amazon CloudFront distribution for the metadata service and configuring it to forward requests to an Application Load Balancer (ALB), which invokes the appropriate Lambda function for each type of request. A Lambda@Edge function can be created that removes the problematic headers based on the value of the User-Agent header before sending the response to the viewer device, ensuring compatibility with older devices without modifying the responses sent to other devices. This approach provides fast, scalable content delivery while retaining the ability to support older devices, minimizing operational overhead. The other options either involve more configurations or do not provide sufficient support for older devices.