Which combination of steps should a solutions architect take to meet these requirements?
(Choose three.)
Create a CloudFront distribution with the EC2 instances as an origin.
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.
Enable S3 Transfer Acceleration on the S3 bucket to allow faster access from CloudFront.
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.
Create a CloudFront distribution with a custom origin.
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.
Explanations:
Using EC2 instances as the origin for CloudFront will still lead to high response times during peak load because CloudFront will frequently need to query the backend, which does not eliminate latency issues effectively.
Lambda@Edge is ideal for customizing requests based on user agent information, enabling CloudFront to determine the correct application configuration dynamically, which reduces the load on the EC2 instances.
S3 Transfer Acceleration speeds up uploads to S3 from distant locations but does not optimize response times for serving content from CloudFront. CloudFront already uses optimized routing, so this would not contribute to a solution.
While S3 Versioning would help with storing multiple versions of the application, it does not facilitate automatic selection of the correct version. Additionally, a maximum TTL would not address the configuration or response time requirements.
Setting up a CloudFront distribution with a custom origin (S3 in this case) allows caching at CloudFront’s edge locations, reducing the need to retrieve content from the EC2 instances repeatedly and improving performance during high loads.
Modifying the build process to create versioned application files allows CloudFront to serve a unique file per configuration, avoiding conflicts. Storing incremented versions in S3 enables easy retrieval and caching at CloudFront edge locations.