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.
You will be practicing this lab using the Amazon EC2 and AWS ELB services.
Duration: 60 minutes
AWS Region: US East (N. Virginia)
Separate bot/crawler traffic from human traffic.
Assign customers or groups of customers to cells (distinct target groups) and route traffic accordingly.
Implement A/B testing.
Perform blue/green or canary deployments.
Route traffic to microservice handlers based on method (PUT, GET etc).
Implement access restrictions based on IP address or CDN (CloudFront).
Selectively route traffic to on-premises or in-cloud target groups.
Deliver different pages or user experiences to various types and categories of devices.
ELB is a service that automatically distributes incoming application traffic and scales resources to meet traffic demands.
ELB helps in adjusting capacity according to incoming application and network traffic.
ELB can be enabled within a single availability zone or across multiple availability zones to maintain consistent application performance.
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.
ELB accepts incoming traffic from clients and routes requests to its registered targets.
When an unhealthy target or instance is detected, ELB stops routing traffic to it and resumes only when the instance is healthy again.
ELB monitors the health of its registered targets and ensures that the traffic is routed only to healthy instances.
ELB's are configured to accept incoming traffic by specifying one or more listeners. A listener is a process that checks for connection requests.
Listeners are configured with a protocol and port number from client to the ELB, and vise-versa i.e., back from ELB to target.
ELB supports 3 types of load balancers:
Application Load Balancers
Network Load Balancers
Classic Load Balancers
Each load balancer is configured differently.
For Application and Network Load Balancers, you register targets in target groups and route traffic to target groups.
For Classic Load Balancers, you register instances with the load balancer.
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.
We can have our load balancer be either internal or internet-facing.
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.
Due to the point above, internet-facing load balancers can route requests from clients over the Internet.
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.
Due to the point above, internal load balancers can only route requests from clients with access to the VPC for the load balancer.
Both internet-facing and internal load balancers route requests to your targets using Private IP addresses.
Your targets do not need Public IP addresses to receive requests from an internal or an internet-facing load balancer.
AWS defines it as Elastic Compute Cloud.
It’s a virtual environment where “you rent” to have your environment created, without purchasing.
Amazon refers to these virtual machines as Instances.
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).
Allows you to install custom applications and services.
Scaling of infrastructure i.e., up or down is easy based on the demand you face.
AWS provides multiple configurations of CPU, memory, storage etc., through which you can pick the flavor that's required for your environment.
No limitation on storage. You can pick the storage based on the type of the instance that you are working on.
Temporary storage volumes are provided, which are called Instance Store Volumes. Data stored in this gets deleted once the instance is terminated.
Persistent storage volumes are available and are referred to as EBS (Elastic Block Store) volumes.
These instances can be placed at multiple locations which are referred to as Regions and Availability Zones (AZ).
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.
Instances deployed in one AZ can be migrated to another AZ.
To manage instances, images, and other EC2 resources, you can optionally assign your own metadata to each resource in the form of tags.
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.
Each AWS account comes with a set of default limits on the resources on a per-Region basis.
For any increase in the limit you need to contact AWS.
To work with the created instances, we use Key Pairs.
Launching Lab Environment.
Launch an EC2 Instance with Bash script.
Create an application Load Balancer.
Configure Advanced-Request Routing.
Test the ELB configuration.