Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
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 (?) , you can switch to a simple comment.
Switch to a voting comment New
EricZhang
Highly Voted 1 year, 10 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 62 times
vn_thanhtung
1 year, 2 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 12 times
...
...
masetromain
Highly Voted 1 year, 11 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 27 times
vn_thanhtung
1 year, 2 months ago
Agree D
upvoted 5 times
...
ninomfr64
11 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 2 times
...
...
MChal
Most Recent 1 day, 7 hours 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
1 week 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
1 week, 1 day 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
1 week, 2 days ago
It says a serverless solution. ALBs are not serverless.
upvoted 1 times
...
Syre
1 month, 1 week 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
1 month, 2 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
1 month, 2 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, 2 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 1 times
...
...
c73bf38
1 month, 2 weeks ago
Selected Answer: D
D: This solution involves creating an Amazon CloudFront distribution for the metadata service and configuring it to forward requests to the Application Load Balancer (ALB), which is used to invoke the correct Lambda function for each type of request. A Lambda@Edge function should be created that will remove the problematic headers in response to viewer requests based on the value of the User-Agent header. This approach allows the company to remove the problematic headers while supporting older devices and using serverless technologies.
upvoted 3 times
...
higashikumi
1 month, 2 weeks ago
D is correct This solution uses Amazon CloudFront with an Application Load Balancer (ALB) and AWS Lambda@Edge to remove problematic headers based on the User-Agent header. CloudFront can be used as a content delivery network (CDN) to deliver the metadata service to consumer devices while the ALB is used to invoke the correct Lambda function for each type of request. Lambda@Edge is used to modify the response headers in real-time based on the User-Agent header. This solution addresses the requirement to support older devices that do not support certain HTTP headers by removing problematic headers based on the value of the User-Agent header. It also leverages serverless technologies such as AWS Lambda and Lambda@Edge for scalability and cost-effectiveness.
upvoted 3 times
...
Jonalb
1 month, 2 weeks ago
Selected Answer: D
In this solution, you use CloudFront, ALB, Lambda@Edge, and Lambda functions to achieve the desired outcome. Create an Amazon CloudFront distribution: CloudFront acts as a content delivery network (CDN) and allows you to distribute your metadata service globally. You can configure it to handle incoming requests and route them to the appropriate backend. Create an Application Load Balancer (ALB): ALB is used as a target for CloudFront to forward requests. It provides advanced routing capabilities and can invoke the correct Lambda function based on the type of request. Create a Lambda@Edge function: Lambda@Edge allows you to run Lambda functions at the CloudFront edge locations, closer to your users. Create a Lambda@Edge function that examines the User-Agent header of incoming requests and removes the problematic headers from the response when necessary. This ensures compatibility with older devices.
upvoted 2 times
...
atirado
1 month, 2 weeks ago
Selected Answer: C
I think thre are two problems in this situation: 1- "Many older devices do not support certain HTTP headers and exhibit errors when these headers are present in responses." 2- "The company has already migrated the applications into a set of AWS Lambda functions" Those two problems are addressed by using an API Gateway which 'selects the appropriate function for each type of request' and a mapping template which 'removes the unsupported headers'.
upvoted 3 times
...
ninomfr64
1 month, 2 weeks ago
Selected Answer: D
This is really challenging for me. Here is my reasoning: i) user-agent header is stored in request and not in answer ii) based on i) we need a mechanism to map sessionid to user-agent in requests and access this mapping when processing answers Not .A as CF Functions do not interact with other AWS services, they can use key value pairs but in read-only mode. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-tutorial-kvs.html Not B. as gateway responses only works with "supported response type" listed here https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html (plese note the question mention errors, but they occur on devices) Not C. as response mapping template do not interact with other AWS services D. is correct as Lambda@Edge can access other AWS services (e.g. in this case a DynamoDB for sessionid user-agent mapping)
upvoted 6 times
...
master9
1 month, 2 weeks ago
Selected Answer: A
To migrate the service to AWS, adopt serverless technologies, and retain the ability to support the older devices, the company can use AWS Application Load Balancer (ALB). The ALB is a serverless technology that can be used to route incoming traffic to serverless functions such as AWS Lambda. The Serverless Framework makes it possible to set up the connection between Application Load Balancers and Lambda functions with the help of the alb event. To support the older devices, the company can configure the ALB to remove the unsupported headers from responses sent to older devices, which the company identified by the User-Agent headers. The ALB’s focus on HTTP allows it to use parts of the protocol to make decisions about caching and save you some Lambda executions.
upvoted 2 times
...
rhinozD
1 month, 2 weeks ago
Selected Answer: C
You guys are discussing CloudFront function and Lambda@Edge but the question says: "adopt serverless technologies". ALB is not a serverless service. I think C is the correct answer.
upvoted 6 times
...
titi_r
1 month, 2 weeks ago
Selected Answer: A
Answer is A. CloudFront Functions is ideal for lightweight, short-running functions for use cases like the following: Header manipulation – You can insert, modify, or delete HTTP headers in the request or response. For example, you can add a True-Client-IP header to every request. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-choosing.html
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 ...