Two EC2 instances with a simple web application that shows the web page with the string "Hey, it's a me, <HOSTNAME>
!"
- Create an application load balancer for the two instances you have, with the following properties
- healthy threshold: 3
- unhealthy threshold: 3
- interval: 10 seconds
- Verify load balancer is working (= you get reply from both instances at different times)
- Go to EC2 service
- Click in the left side menu on "Load balancers" under "Load balancing"
- Click on "Create load balancer"
- Choose "Application Load Balancer"
- Insert a name for the LB
- Choose an AZ where you want the LB to operate
- Choose a security group
- Under "Listeners and routing" click on "Create target group" and choose "Instances"
- Provide a name for the target group
- Set healthy threshold to 3
- Set unhealthy threshold to 3
- Set interval to 10 seconds
- Click on "Next" and choose the two of the instances you've created
- Click on "Create target group"
- Refresh target groups and choose the one you've just created
- Click on "Create load balancer" and wait for it to be provisioned
- Copy DNS address and paste it in the browser. If you refresh, you should see different message based on the instance where the traffic was routed to