CertKeen

AWS Solutions Architect Professional (SAP-C03) · Free practice question 1 of 12

CloudFront Functions for lightweight edge logic

Morland Books serves its storefront through Amazon CloudFront and receives 50,000 requests per second at peak. On every viewer request it must normalize the Accept-Language header and redirect legacy /shop/ paths to /store/. The logic needs no network calls and must add as little latency and cost as possible. Where should this logic run?

  1. A.In a CloudFront Function attached to the viewer request event
  2. B.In an AWS WAF rule group with a custom response for each path
  3. C.In a Lambda@Edge function attached to the origin response event
  4. D.In a Lambda function invoked by the origin web servers per request
Show answer and explanation

Correct answer: A. In a CloudFront Function attached to the viewer request event

Why: CloudFront Functions run lightweight JavaScript at edge locations on viewer request and response events with sub-millisecond execution and lower cost than Lambda@Edge, which suits header normalization and redirects at very high request rates. Lambda@Edge is for heavier logic, such as network calls or body access, and the origin response event fires too late to change cache keys. WAF rules filter traffic rather than rewrite headers. Running the logic at the origin adds round trips and defeats edge caching.

More free AWS Solutions Architect Professional (SAP-C03) questions