AWS Certified Solutions Architect – Associate (SAA-C02) — Question 276
A company that operates a web application on premises is preparing to launch a newer version of the application on AWS. The company needs to route requests to either the AWS-hosted or the on-premises-hosted application based on the URL query string. The on-premises application is not available from the internet, and a VPN connection is established between Amazon VPC and the company's data center. The company wants to use an Application Load Balancer (ALB) for this launch.
Which solution meets these requirements?
Answer options
- A. Use two ALBs: one for on-premises and one for the AWS resource. Add hosts to each target group of each ALB. Route with Amazon Route 53 based on the URL query string.
- B. Use two ALBs: one for on-premises and one for the AWS resource. Add hosts to the target group of each ALB. Create a software router on an EC2 instance based on the URL query string.
- C. Use one ALB with two target groups: one for the AWS resource and one for on premises. Add hosts to each target group of the ALB. Configure listener rules based on the URL query string.
- D. Use one ALB with two AWS Auto Scaling groups: one for the AWS resource and one for on premises. Add hosts to each Auto Scaling group. Route with Amazon Route 53 based on the URL query string.
Correct answer: C
Explanation
An Application Load Balancer (ALB) can route traffic to both AWS resources and on-premises servers (via IP addresses over a VPN or Direct Connect connection) using target groups. By configuring ALB listener rules, traffic can be routed to different target groups based on query string parameters in the URL. Amazon Route 53 cannot perform routing based on URL query strings, making the other options incorrect.