1. Launch second EC2 instance
Naming the first EC2 instance Web Server 1

Click Action / Image & templates / Launch more like this

Click Launch

Launch instances

Launching…

Naming Web Server 2

The Web Server 2 is up.

Try to access the website by using the public IP address

2. Create an Elastic LB
On the EC2 dashboard, click on Load Balancers / Click Create Load Balancer

Click Create on HTTP/HTTPS

Enter the name of the ELB. Eg: elb-demo

Select the Availability Zones

Click Next: Configure Security Settings

Click Next: Configure Security Groups

Click Select an existing security group / Your default security group / Click Next: Configure Routing

Configure Target Group
Name: demo-tg
Click Next: Register Targets

Select two EC2 instances and click Add to registered

Click Next: Review

Click Create


Provisioning…

Copy DNS Name and try to open from your web browser

Basic website with local hostname on the content by using userdata.

It is randomly to switch between two EC2 instances.

Target Groups demo-tg

Targets
Congratulations! You have created the Elastic Load Balancer successfully.