AWS Certified Solutions Architect - Associate / Question #1280 of 1019

Question #1280

A company has launched its online storefront using Amazon EC2 instances behind an Elastic Load Balancer, with instances in an Auto Scaling group across multiple Availability Zones. They need to serve different content versions depending on whether users access the site via mobile devices or desktops.

Which two steps should a solutions architect take to meet this requirement? (Choose two.)

A

Configure Amazon CloudFront to cache separate content versions for mobile and desktop users.

B

Set up a host-based routing policy in the Application Load Balancer to direct traffic to different instance groups.

C

Use a Lambda@Edge function to inspect the User-Agent header and serve the corresponding content version.

D

Deploy AWS Global Accelerator with a Network Load Balancer configured for path-based routing to different EC2 instances.

E

Implement an Amazon API Gateway with custom authorizers to route requests based on device type.

Explanation

Answer A is correct because Amazon CloudFront can cache different content versions based on device type by including the User-Agent header in the cache key. This ensures mobile and desktop users receive the appropriate cached content. Answer C is correct because Lambda@Edge allows inspection of the User-Agent header at the edge, enabling dynamic content routing or request modification to serve the correct version.

Other options are incorrect: B (ALB host-based routing) would require separate instance groups and isn't ideal for User-Agent-based routing. D (Global Accelerator with NLB) doesn't support layer 7 routing. E (API Gateway) is unnecessary for this scenario, as the setup already uses EC2 and ELB.

Answer

The correct answer is: AC