Application Load Balancer Setup for EC2
Tasks
- Set up an Application Load Balancer named - xfusion-alb.
- Create a target group named - xfusion-tg.
- Create a security group named - xfusion-sgto open port- 80for the public.
- Attach this security group to the ALB. 
- Configure the ALB to route traffic on port - 80to port- 80of the- xfusion-ec2instance.
- Make necessary changes to the default security group attached to the EC2 instance if needed. 
Steps
- Checkout the ec2 → instance (xfusion-ec2) 
 - Select load balancer.  
- Create Application Load Balancer - EC2 → Load balancers → Compare and select load balancer type  
- Pick subnet from our ec2  
- Name the load balancer.  
- Select availability zone, atleast two; one from our ec2 subnet and another any of remaining subnet.  
- Create target group.  - EC2 → Target groups → Create target group - Choose a target type → Instances  
 
- Name the group, xfusion-tg.  
- Select Next 
   - Successfully created the target group: xfusion-tg. 
 - Now, select a target group. 
 - Successfully created load balancer: xfusion-alb 
 - Security group (sg-097258aa3bafd5395 | xfusion-sg) was created successfully - EC2 → Security Groups → sg-097258aa3bafd5395 - xfusion-sg 
 
- Let’s config security group on instances to for alb. - EC2 → Security Groups → sg-05a1bf9fe7738fdb5 - default → Edit inbound rules  
- Inbound security group rules successfully modified on security group (sg-05a1bf9fe7738fdb5 | default) 
 - Register targets 
 - EC2 → Target groups → xfusion-tg → Register targets 
 - Register pending targets 
 - One target registered successfully to xfusion-tg. And health status is healthy  
- We have load balancer now. 
 - Now checkout the dns name.   
Boom!! We finally did this: Setting Up an Application Load Balancer for an EC2 Instance. :)
#happylearning #loadbalancer #alb