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, 3 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
1 month, 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
1 month, 2 weeks ago
Where the function is integrated - it is already past the ALB.
upvoted 1 times
...
...
vn_thanhtung
1 year, 7 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, 3 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 28 times
vn_thanhtung
1 year, 7 months ago
Agree D
upvoted 5 times
...
ninomfr64
1 year, 3 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
...
...
ParamD
Most Recent 1 week ago
Selected Answer: A
CloudFront functions are the easiest way to manipulate response headers
upvoted 1 times
...
BennyMao
1 week, 4 days ago
Selected Answer: D
CloudFront functions cannot modify response headers, which is a key requirement.
upvoted 1 times
...
soulation
3 weeks, 5 days 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
1 month, 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
1 month, 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
3 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 1 times
...
julianocaldeira
4 months 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
2 months, 2 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
4 months 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
4 months 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
4 months, 2 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
4 months, 2 weeks 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
4 months, 2 weeks 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
...
0b43291
4 months, 3 weeks ago
It says a serverless solution. ALBs are not serverless.
upvoted 1 times
...
Syre
5 months, 3 weeks ago
Selected Answer: D
Lambda@Edge is integrated with CloudFront and allows you to manipulate requests and responses closer to the user, such as removing unsupported headers. This is ideal for addressing the issue with older devices by inspecting the User-Agent header and removing the problematic HTTP headers.
upvoted 1 times
...
pppttl
5 months, 3 weeks ago
Selected Answer: A
A, because it's faster. CloudFront Functions vs. Lambda@Edge use cases * CF Functions: * cache key normalization: transform request attributes (headers, cookies, query string, URL) to create an optimal Cache Key * header manipulation: insert/modify/delete HTTP headers in the request or response * URL rewrites or redirects * request authentication & authorization: create and validate user-generated tokens (e. g. JWT) to allow/deny requests * Lambda@Edge: * longer execution time (several ms) * adjustable CPU or memory * 3rd party dependencies (like AWS SDK) * network access to use external services for processing * file system access or access to the body of HTTP requests
upvoted 5 times
...
SubbuKhan
5 months, 3 weeks ago
Selected Answer: D
Lambda@Edge lets you run Lambda functions to customize the content that CloudFront delivers, executing the functions in AWS locations closer to the viewer. The functions run in response to CloudFront events, without provisioning or managing servers. You can use Lambda functions to change CloudFront requests and responses at the following points: - After CloudFront receives a request from a viewer (viewer request) - Before CloudFront forwards the request to the origin (origin request) - After CloudFront receives the response from the origin (origin response) - Before CloudFront forwards the response to the viewer (viewer response)
upvoted 1 times
RotterDam
1 year, 7 months ago
CF Functions can do this as well - why use Lambda@Edge when you can do it at 1/6th the price with CF Functions?
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago