Question #1161
An ecommerce company has deployed a web application on Amazon EC2 instances. The company needs to route incoming HTTP traffic to different groups of instances based on the content of the request, such as URL paths or hostnames.
Which AWS service or resource will meet this requirement?
Amazon EC2 Auto Scaling
Application Load Balancer
Gateway Load Balancer
Network Load Balancer
Explanation
The correct answer is B. Application Load Balancer (ALB).
Why ALB?
- ALB operates at Layer 7 (HTTP/HTTPS) and supports advanced routing features like path-based routing, host-based routing, and query string parameters. This allows traffic to be directed to specific instance groups based on the content of the request.
- For example, requests to /images/*
can be routed to one group of instances, while /api/*
can go to another group.
Why Other Options Are Incorrect:
- A. Amazon EC2 Auto Scaling: Manages instance scaling but does not handle traffic routing.
- C. Gateway Load Balancer (GLB): Designed for deploying third-party network appliances (e.g., firewalls) and operates at Layer 3 (IP), not for HTTP content-based routing.
- D. Network Load Balancer (NLB): Operates at Layer 4 (TCP/UDP) and routes traffic based on IP/port, not HTTP content.
Key Points to Remember:
- Use ALB for HTTP/HTTPS routing based on content (e.g., URL paths, hostnames).
- NLB and GLB are unsuitable for application-layer routing requirements.
Answer
The correct answer is: B