Listener rules define how a load balancer routes incoming requests based on conditions such as host headers, paths, HTTP methods, query parameters, and source IP addresses, with actions like forwarding, redirecting, or returning fixed responses [citation:1][citation:2].
Listener rules are a key feature of the Application Load Balancer (ALB). You configure rules for each listener on the load balancer. Each rule consists of a condition and an action [citation:2]. Supported conditions include [citation:1]:
Host header: Route based on the domain name (e.g., api.example.com vs www.example.com).
Path: Route based on the URL path (e.g., /images/* vs /video/*).
HTTP headers: Route based on standard or custom HTTP headers.
HTTP methods: Route based on the HTTP method (e.g., GET vs POST).
Query parameters: Route based on query string parameters.
Source IP CIDR: Route based on the client's IP address range.
Supported actions include [citation:1][citation:2]:
forward: Route the request to a target group.
redirect: Redirect the client to a different URL (e.g., from HTTP to HTTPS).
fixed-response: Return a custom HTTP response (e.g., a 404 page) directly from the load balancer.
authenticate: Authenticate users via Amazon Cognito or an OIDC-compliant IdP.
You need to expose two microservices, one serving /api/* and another serving /static/*, behind an ALB. How would you configure listener rules to route traffic correctly?
If you add a new host‑based rule for admin.example.com but forget to set its priority, what will happen to incoming requests?
What occurs when two listener rules have overlapping path patterns and the same priority?
During a rollout you notice requests to /beta still hit the old service after updating the listener rule. Walk me through how you'd debug the issue.
Explain the trade‑offs between host‑based routing and path‑based routing when you have dev, staging, and prod environments sharing a domain.
You want to implement a canary deployment using listener rules. How would you set up weighted target groups and what considerations are important?
At scale you have 100 listener rules on a single ALB and see increased latency in rule evaluation. How would you redesign the routing to mitigate this?
Discuss how listener‑rule limits and priority ordering affect a multi‑tenant SaaS platform’s ability to isolate customer traffic.
If you need to migrate from Classic ELB to ALB while preserving complex listener‑rule logic, what steps and pitfalls would you consider?
Your organization is moving from many regional ALBs to a global traffic manager. How would you abstract listener‑rule logic to support this migration while minimizing operational overhead?
Design a strategy for centrally managing listener‑rule configurations across dozens of teams and services, ensuring consistency, auditability, and safe rollouts.
Regulatory compliance requires different TLS policies per customer. How would you incorporate that requirement into listener‑rule design at the architecture level?