Support Documents
No data found.

Understanding AWS ALB Advanced Request Routing

Lab Details

  1. This lab walks you through the creation of an Amazon EC2 instance with Apache web server installed and containing an HTML page that can be accessed publicly. Next, you will create an Application Load Balancer which distributes incoming traffic to the Amazon EC2 instance and also add query string and Http Header based routing in the ELB.

  2. You will be practicing this lab using the Amazon EC2 and AWS ELB services.

  3. Duration: 60 minutes

  4. AWS Region: US East (N. Virginia) us-east-1


Advanced-Request Routing use cases

  1. Separate bot/crawler traffic from human traffic.

  2. Assign customers or groups of customers to distinct target groups and route traffic accordingly.

  3. Implement A/B testing.

  4. Perform blue/green or canary deployments.

  5. Route traffic to microservice handlers based on method (PUT, GET, etc).

  6. Implement access restrictions based on IP address or CDN (CloudFront).

  7. Selectively route traffic to on-premises or in-cloud target groups.

  8. Deliver different pages or user experiences to various types and categories of devices.

What is Elastic Load Balancing?

  1. ELB is a service that automatically distributes incoming application traffic to the underlying application.

  2. ELB can be enabled within a single availability zone or across multiple availability zones to maintain consistent application performance.

  3. ELB offers features like:

  • Detection of unhealthy EC2 instances.

  • Spreading EC2 instances across healthy channels only.

  • Centralized management of SSL certificates.

  • Optional public key authentication.

  • Support for both IPv4 and IPv6.

  1. ELB accepts incoming traffic from clients and routes requests to its registered targets.

  2. When an unhealthy target or instance is detected, ELB stops routing traffic to it and resumes only when the instance is healthy again.

  3. ELB monitors the health of its registered targets and ensures that the traffic is routed only to healthy instances.

  4. ELB's are configured to accept incoming traffic by specifying one or more listeners. A listener is a process that checks for connection requests.

  5. Listeners are configured with a protocol and port number from the client to the ELB, and vise-versa i.e., back from ELB to target.

  6. ELB supports 3 types of load balancers:

    • Application Load Balancers

    • Network Load Balancers

    • Classic Load Balancers

  7. Each load balancer is configured differently.

  8. For Application and Network Load Balancers, you register targets in target groups and route traffic to target groups.

  9. For Classic Load Balancers, you register instances with the load balancer.

  10. AWS recommends users to work with Application Load Balancer to use multiple Availability Zones because if one availability zone fails, the load balancer can continue to route traffic to the next available one.

  11. We can have our load balancer be either internal or internet-facing.

  12. The nodes of an internet-facing load balancer have Public IP addresses, and the DNS name is publicly resolvable to the Public IP addresses of the nodes.

  13. Due to the point above, internet-facing load balancers can route requests from clients over the Internet.

  14. The nodes of an internal load balancer have only Private IP addresses, and the DNS name is publicly resolvable to the Private IP addresses of the nodes.

  15. Due to the point above, internal load balancers can only route requests from clients with access to the VPC for the load balancer.

  16. Both internet-facing and internal load balancers route requests to your targets using Private IP addresses.

  17. Your targets do not need Public IP addresses to receive requests from an internal or an internet-facing load balancer.

What is Amazon EC2?

  1. AWS defines it as Elastic Compute Cloud.

  2. It’s a virtual environment where “you rent” to have your environment created, without purchasing.

  3. Amazon refers to these virtual machines as Instances.

  4. Preconfigured templates can be used to launch instances. These templates are referred to as images. Amazon provides these images in the form of AMIs (Amazon Machine Images).

  5. Allows you to install custom applications and services.

  6. Scaling of infrastructure i.e., up or down is easy based on the demand you face.

  7. AWS provides multiple configurations of CPU, memory, storage, etc., through which you can pick the flavor that's required for your environment.

  8. No limitation on storage. You can pick the storage based on the type of instance that you are working on.

  9. Temporary storage volumes are provided, which are called Instance Store Volumes.  Data stored in this gets deleted once the instance is terminated.

  10. Persistent storage volumes are available and are referred to as EBS (Elastic Block Store) volumes.

  11. These instances can be placed at multiple locations which are referred to as Regions and Availability Zones (AZ).

  12. You can have your Instances distributed across multiple AZs i.e., within a single Region, so that if an instance fails, AWS automatically remaps the address to another AZ.

  13. Instances deployed in one AZ can be migrated to another AZ.

  14. To manage instances, images, and other EC2 resources, you can optionally assign your own metadata to each resource in the form of tags.

  15. A Tag is a label that you assign to an AWS resource.  It contains a key and an optional value, both of which are defined by you.

  16. Each AWS account comes with a set of default limits on the resources on a per-Region basis.

  17. For any increase in the limit, you need to contact AWS.

  18. To work with the created instances, we use Key Pairs.

Architecture Diagram


Task Details

  1. Launching Lab Environment.

  2. Launch an EC2 Instance with a Bash script.

  3. Create an Application Load Balancer.

  4. Configure Advanced-Request Routing.

  5. Test the ELB configuration.

  6. Validation of the lab.

  7. Deleting AWS Resources.