AWS Application Load Balancer (ALB) Rules Overview
- Rules Configuration:
- Rules are set up on your ALB.
- You can have multiple rules, with the last one being the default rule.
- Each rule directs traffic to a specific target or action.
- Rules Processing:
- Rules are processed in the order they are set.
- The default rule is processed last.
- Supported Actions:
- Forwarding to a target group.
- Redirecting to a different URL.
- Sending a fixed response.
- Rule Conditions:
- Host header: Based on the client request's host.
- HTTP request method: Identifies if the request is GET, POST, PUT, etc.
- Path pattern: Directs requests to specific paths like
/myapp1 or /myapp2.
- Source IP: Filters requests based on the originating IP address. https://repost.aws/knowledge-center/elb-route-requests-with-source-ip-alb
- HTTP headers: Uses specific headers to route requests.
- Query string parameters: Utilizes the request's query parameters.
- Multiple Target Groups:
- A single rule can forward to multiple target groups.
- Weights can be assigned to each target group within a rule.
- Weighted Target Groups:
- Allows for controlled traffic distribution between different versions of a service.
- Facilitates blue-green deployments.
- Example: 80% of traffic to target group one (blue), 20% to target group two (green).

- Monitoring and Evaluation:
- Enables monitoring of target groups to ensure they handle traffic correctly.
- Allows assessment of new application versions based on performance metrics.
Example Scenario
- Historical Setup:
- Users communicate with the ALB.
- ALB is configured to route traffic to target group one (blue).
- New Setup:
- A second target group (green) is introduced for a new version of the application.
- Rule weights are configured: 8 for target group one, 2 for target group two.
- ALB now routes 80% of traffic to the first group and 20% to the second group.
- This setup allows for performance monitoring and validation of the new application version.
Conclusion
- The lecture covered the importance of ALB rules for directing traffic and facilitating service updates through blue-green deployments. The ability to assign weights to target groups within a rule is a powerful feature for gradually introducing new versions of an application while monitoring their performance.