AWS Certified Solutions Architect – Professional — Question 809
A media company has a video-streaming application that runs on smart TVs. The application is written in HTML and JavaScript. A configuration exists for each smart TV type to control application behavior, such as whether the application should offer high-definition content. The configuration typically changes each quarter.
The company serves the application from a fleet of Amazon EC2 instances that handle the requests from the smart TVs. On each request, an application template and smart TV configuration are retrieved from Amazon S3 and are merged to produce the customized application.
The company's current solution produces high response times during peak load. The company wants to use Amazon CloudFront to deliver and cache the application.
Which combination of steps should a solutions architect take to meet these requirements? (Choose three.)
Answer options
- A. Create a CloudFront distribution with the EC2 instances as an origin.
- B. Create a Lambda@Edge function to be invoked by an origin request event. Determine the smart TV type by inspecting the user agent in the event. Modify the request URI to point to the application file from the S3 bucket.
- C. Enable S3 Transfer Acceleration on the S3 bucket to allow faster access from CloudFront.
- D. Enable S3 Versioning on the S3 bucket that hosts the object. Modify the application build process to create a single application file for each configuration. Push the file to the S3 bucket by using the same name to create a new version. Set a Maximum TTL on the object.
- E. Create a CloudFront distribution with a custom origin.
- F. Modify the application build process to create a single application file for each configuration. Upload the application files to the S3 bucket with an incremented version number in the object name. Create an S3 webpage redirect to redirect requests for the customized application to the latest version of the file. Set a Maximum TTL on the object.
Correct answer: B, E, F
Explanation
To resolve high latency, the application should be pre-built and cached at the edge rather than dynamically merged on EC2 instances for every request. Using a CloudFront distribution with a custom origin (E) and a Lambda@Edge function (B) allows the system to inspect the User-Agent and route the request to the correct pre-built application file stored in S3. Versioning the files in S3 and using website redirects with a Maximum TTL (F) ensures that the latest configuration changes are reliably served and cached without stale content issues.