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, 8 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 64 times
RyGuy2025
6 months, 2 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
6 months, 2 weeks ago
Where the function is integrated - it is already past the ALB.
upvoted 1 times
...
...
vn_thanhtung
1 year, 12 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, 8 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 32 times
vn_thanhtung
1 year, 12 months ago
Agree D
upvoted 5 times
...
ninomfr64
1 year, 8 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
...
...
Kp002
Most Recent 1 week, 5 days ago
Selected Answer: D
Lambda@Edge runs in the CloudFront edge locations and can modify responses before they are sent to the client — perfect for removing or rewriting headers based on the User-Agent.
upvoted 1 times
...
beeeri
2 weeks, 1 day ago
Selected Answer: D
Lambda@Edge function is AWS recommended
upvoted 1 times
...
percolate792
1 month, 1 week ago
Selected Answer: D
Option D because CloudFront Functions only support the following event types: viewer-request viewer-response BUT: In the viewer-response phase, CloudFront Functions are read-only. You cannot modify or remove headers in the response — you can only read them. From AWS docs: Viewer response events are read-only. You can’t change the headers or the body of the response.
upvoted 1 times
...
princajen
1 month, 1 week ago
Selected Answer: D
Lambda@Edge is the only option that can inspect the request (User-Agent) and modify the response (remove headers) at the edge, fulfilling all functional and architectural requirements.
upvoted 1 times
...
0dc6cac
1 month, 4 weeks ago
Selected Answer: B
There is no way A or D are the answers here....ALB + lambda target groups are NOT SERVERLESS...also we don't know the exact nature of the application, it might not be efficient or even possible to use ALB + lambda, if it involves API keys or some complex routing mechanism. AWS would NEVER prefer that we use ALB + lambda TGs to do something like this. I'd say B is most likely the answer.
upvoted 1 times
...
jimee11
3 months, 2 weeks ago
Selected Answer: A
CloudFreont functions provide better solution approach for lightweight tasks i.e. header manipulation and basic URL rewrites.
upvoted 1 times
...
Hello43638
3 months, 3 weeks 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
4 months 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
4 months, 1 week 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
4 months, 3 weeks ago
Selected Answer: A
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-choosing.html
upvoted 1 times
...
ParamD
5 months, 1 week ago
Selected Answer: A
CloudFront functions are the easiest way to manipulate response headers
upvoted 1 times
...
BennyMao
5 months, 1 week ago
Selected Answer: D
CloudFront functions cannot modify response headers, which is a key requirement.
upvoted 2 times
...
soulation
5 months, 4 weeks 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
6 months, 2 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
6 months, 2 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
8 months 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 2 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 ...