Classic Load Balancer
Follow the below steps to create your Load Balancer
Select a Load Balancer type
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
- On the navigation bar, choose a region for your load balancer. Be sure to select the same region that you selected for your EC2 instances.
- On the navigation pane, under LOAD BALANCING, choose Load Balancers.
- Choose Create Load Balancer.
- For Classic Load Balancer, choose Create.
Define your Load Balancer
You must provide a basic configuration for your load balancer, such as a name, a network, and a listener.
- For Load Balancer Name, type a name for your load balancer.
- For Create ELB inside, select the same network that you selected for your instances: EC2-Classic or a specific VPC.
- [Default VPC] If you selected a default VPC and would like to choose the subnets for your load balancer, select Enable advanced VPC configuration.
- Leave the default listener configuration.
- [EC2-VPC] For Available subnets, select at least one available public subnet using its add icon. The subnet is moved under Selected subnets. To improve the availability of your load balancer, select more than one public subnet.
- Choose Next: Assign Security Groups.
Assign Security Groups to Your Load Balancer in a VPC
If you selected a VPC as your network, you must assign your load balancer a security group that allows inbound traffic to the ports that you specified for your load balancer and the health checks for your load balancer.
- On the Assign Security Groups page, select Create a new security group.
- Type a name and description for your security group, or leave the default name and description. This new security group contains a rule that allows traffic to the port that you configured your load balancer to use.
- Choose Next: Configure Security Settings.
- For this tutorial, you are not using a secure listener. Choose Next: Configure Health Check to continue to the next step.
Configure Health Checks for Your EC2 Instances
Elastic Load Balancing automatically checks the health of the EC2 instances for your load balancer. If Elastic Load Balancing finds an unhealthy instance, it stops sending traffic to the instance and reroutes traffic to healthy instances.
- On the Configure Health Check page, leave Ping Protocol set to HTTP and Ping Port set to 80.
- For Ping Path, replace the default value with a single forward slash ("/"). This tells Elastic Load Balancing to send health check queries to the default home page for your web server, such as index.html.
- For Advanced Details, leave the default values.
- Choose Next: Add EC2 Instances.
Register EC2 Instances with Your Load Balancer
Your load balancer distributes traffic between the instances that are registered to it.
- On the Add EC2 Instances page, select the instances to register with your load balancer.
- Leave cross-zone load balancing and connection draining enabled.
- Choose Next: Add Tags.
Alternatively, you can register instances with your load balancer later on using the following options:
Tag Your Load Balancer (Optional)
You can tag your load balancer, or continue to the next step. Note that you can tag your load balancer later on; for more information, see Tag Your Classic Load Balancer.
- On the Add Tags page, specify a key and a value for the tag.
- To add another tag, choose Create Tag and specify a key and a value for the tag.
- After you are finished adding tags, choose Review and Create.
Create Your Load Balancer
Before you create the load balancer, review the settings that you selected.
- On the Review page, choose Create.
- After you are notified that your load balancer was created, choose Close.