Load Balancing: Add an Application Load Balancer
Objective
- Run our application on more than one EC2 instance.
Steps
- Add an Application Load Balancer.
Adding the load balancer
Until now, we have been relying on EC2’s default network configuration, but by adding a load balancer we’re going to have to explicitly define a VPC setup in our CloudFormation template.
We’re also going to make sure that our two instances will be running in separate availability zones. This is a fundamental requirement for ensuring high availability when using EC2. We recommend James Hamilton’s video Failures at Scale and How to Ignore Them from 2012 as a good introduction to how AWS thinks about availability zones and high availability.
The VPC and subnets will require IP address allocations, for which we need to use CIDR (Classless inter-domain routing) notation. A full discussion of CIDR concepts is beyond the ...
Access this course and 1400+ top-rated courses and projects.