Assignment 1 – ELB Assignment

Problem Statement: You work for XYZ Corporation that uses on premise solutions and some limited number of systems. With the increase in requests in their application, the load also increases. So, to handle the load the corporation has to buy more systems almost on a regular basis. Realizing the need to cut down the expenses on systems, they decided to move their infrastructure to AWS.

Tasks To Be Performed:

  1. Create a Classic Load Balancer and register 3 EC2 instances with different web pages running in them.
  2. Migrate the Classic Load Balancer into an Application Load Balancer.

Creation of the Three EC2 Instances:

Created 3 EC2 instances with the following:

  • Security Group Attached: I attached a security group to each of the three instances that allows HTTP, HTTPS, and SSH from all sources.

  • Commands Executed on Each EC2 Instance:

# Update the package manager
sudo yum update
# Install the Apache web server
sudo yum install httpd -y
# Start the Apache web server
sudo systemctl start httpd
# Create a web page
echo "Hello from Instance1!" | sudo tee /var/www/html/index.html
# Restart the Apache web server
sudo systemctl restart httpd

Changed: "Hello from Instance[1,2,3]!" for each instance

Creating a Classic Load Balancer:

  1. Open AWS Management Console:

    • I’ll log into my AWS account and go to the EC2 dashboard.
  2. Start Creating the Classic Load Balancer:

    • Under the Load Balancers section, I’ll click on Create Load Balancer.
  • I’ll choose Classic Load Balancer and hit Create.
  1. Set Up the Load Balancer:
  • I’ll give it a unique name.
  • I’ll ensure it’s in my desired VPC and Mappings us-east-1a (use1-az6) is selected since my EC2s are in Availability Zone us-east-1a.
  • Under Listeners and routing, I’ll ensure HTTP is set up.
  1. Assigning Security Groups:
  • I’ll click “Next: Assign Security Groups”.
  • I’ll select the security group I previously created that allows HTTP, HTTPS, and SSH.
  1. Configure Health Checks:
  • I’ll set the Ping Protocol to HTTP, Ping Port to 80, and Ping Path to /index.html.
  1. Adding My EC2 Instances:
  • I’ll click on Add instances.
  • I’ll select the three instances I set up manually.
  1. Finalize Creation:
  • I’ll review everything and click Create load balancer.


When I open the browser using the DNS name of the load balancer, I see that it hits all three servers.


Migrating to an Application Load Balancer:

To migrate a Classic Load Balancer to an ALB using the migration wizard, follow these steps:

  1. Open the AWS Elastic Load Balancing console.
  2. In the left pane, click Load Balancers.
  3. Select the Classic Load Balancer that you want to migrate.
  4. Click the Migration tab.
  5. Click the Launch ALB Migration Wizard button.
  6. Follow the instructions in the wizard to migrate your Classic Load Balancer to an ALB.

Once the migration is complete, you will be able to use the ALB to load balance your traffic.