exam questions

Exam AWS Certified Solutions Architect - Professional SAP-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional SAP-C02 exam

Exam AWS Certified Solutions Architect - Professional SAP-C02 topic 1 question 5 discussion

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.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
EricZhang
Highly Voted 2 years, 4 months ago
A. The only difference between A and D is CloudFront function vs Lambda@Edge. In this case the CloudFront function can remove the response header based on request header and much faster/light-weight.
upvoted 63 times
RyGuy2025
2 months, 3 weeks ago
If you read the solution - it does not reference a CloudFront Function, it references a Cloud Front Distribution, which is not the same. That is why B is the best answer.
upvoted 1 times
RyGuy2025
2 months, 3 weeks ago
Where the function is integrated - it is already past the ALB.
upvoted 1 times
...
...
vn_thanhtung
1 year, 8 months ago
After read, answer A "Create a CloudFront function to remove the problematic headers based on the value of the User-Agent header" not really clear and fuzzy, "The company has configured an on-premises load balancer to remove the unsupported headers from responses sent to older devices" => "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" => D make sence
upvoted 13 times
...
...
masetromain
Highly Voted 2 years, 4 months ago
I think this is answer D: Lambda@Edge can modify headers https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-examples.html
upvoted 29 times
vn_thanhtung
1 year, 8 months ago
Agree D
upvoted 5 times
...
ninomfr64
1 year, 4 months ago
Agree on D, but also CloudFront Function can manipulate headers https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-functions.html#:~:text=cache%20hit%20ratio.-,Header%20manipulation,-%E2%80%93%20You%20can%20insert
upvoted 3 times
...
...
Hello43638
Most Recent 4 days, 2 hours ago
Selected Answer: D
➡️ This is where CloudFront Functions falls short: While it can manipulate response headers, it cannot access request headers during the response phase. So it can’t conditionally remove headers from responses based on User-Agent.
upvoted 1 times
...
unbornfroyo
1 week, 1 day ago
Selected Answer: D
TL;DR: You need to remove specific headers based on User-Agent in the response, best done at the edge. Lambda@Edge with CloudFront is the only option here that fully supports this requirement.
upvoted 1 times
...
chucky41_1
2 weeks, 3 days ago
Selected Answer: C
Answer: C Question mentions to use serverless technologies, API Gateway and Lambda considerd as serverless. so answer A & D can be ommited and B or C are the remaining options, but since Option C mentions mapping templates, which has ability to modify the request. that is the probable answer.
upvoted 1 times
...
cloudlab
1 month ago
Selected Answer: A
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-choosing.html
upvoted 1 times
...
ParamD
1 month, 2 weeks ago
Selected Answer: A
CloudFront functions are the easiest way to manipulate response headers
upvoted 1 times
...
BennyMao
1 month, 3 weeks ago
Selected Answer: D
CloudFront functions cannot modify response headers, which is a key requirement.
upvoted 1 times
...
soulation
2 months ago
Selected Answer: A
While D might work, it's overkill for this use case. Cloudfront function is 600% cheaper, less latency, less code size. Correct answer is A.
upvoted 1 times
...
RyGuy2025
2 months, 3 weeks ago
Selected Answer: B
I'm going to wade in here and vote B as the most efficient and cost effective deployment option - here's why: REST APIs natively support header modifications and API Gateway responses can be customized based on conditions (major feature). You can easily integrate the already moved Lamda functions - no additional components required. Lastly, the solution meets the serverless requirement and is more cost effective than the others.
upvoted 2 times
RyGuy2025
2 months, 3 weeks ago
Following this up to say after further research I believe B is wrong - no way to remove though.. sry ppl - API Gateway REST APIs cannot natively modify response headers based on the User-Agent header in a conditional way - sry ppl
upvoted 1 times
...
...
pk0619
4 months, 1 week ago
Selected Answer: A
CloudFront Functions is ideal for lightweight, short-running functions for the following use cases: Header manipulation – Insert, modify, or delete HTTP headers in the request or response. For example, you can add a True-Client-IP header to every request
upvoted 1 times
...
julianocaldeira
5 months, 1 week ago
The correct answer is D. Here’s why: Requirement: The solution must: Use serverless technologies. Retain the ability to support older devices by removing problematic headers based on the User-Agent header. Analysis of the options: A. CloudFront with an ALB and a CloudFront function: CloudFront functions can modify headers, but they are limited to request handling and cannot modify response headers. This does not fully meet the requirement to remove response headers based on the User-Agent header.
upvoted 1 times
Kirkster
3 months, 3 weeks ago
According to the docs, CloudFront functions can, "Insert, modify, or delete HTTP headers in the request or response." So A is the better choice. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-choosing.html
upvoted 1 times
...
...
ad11934
5 months, 1 week ago
Option A as per https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-choosing.html -- seems lambda@edge is not needed as cloudfront function can be quick for modifying the response headers and handles higher request rates
upvoted 1 times
...
CGarces
5 months, 1 week ago
Selected Answer: A
It's A. Cloudfront funtions are faster and cheaper than Lambda@Edge. The use case in the question (add headers if missing from old devices) is documented on the AWS samples https://github.com/aws-samples/amazon-cloudfront-functions/tree/main/add-origin-header
upvoted 3 times
...
MChal
5 months, 3 weeks ago
Option A or D are viable. I went with D because Lambda@Edge offers better performance since it runs closer to the end-users, reducing latency. Lambda@Edge can also handle more complex logic and is always more suitable for modifying headers based on User-Agent. While A could work, D offers a more robust and scalable solution that better aligns with the company's requirements to support older devices and leverage serverless technologies effectively.
upvoted 1 times
...
TariqKipkemei
6 months ago
Selected Answer: A
CloudFront lets you choose whether you want CloudFront to forward headers to your origin and to cache separate versions of a specified object based on the header values in viewer requests. This allows you to serve different versions of your content based on the device the user is using, the location of the viewer, the language the viewer is using, and a variety of other criteria.
upvoted 1 times
...
AloraCloud
6 months ago
Removing User-Agent headers is generally a lightweight task. Since it involves simple string manipulation to detect and remove headers based on predefined conditions, CloudFront Functions (Option A) are perfectly suited for this purpose. They provide fast, low-latency execution, making them ideal for straightforward operations like header manipulation.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago