Let’s begin with the connection of the EC2 occasion to the load balancer.
How you can Create a Load Balancer?
Go to the EC2 dashboard and click on on the “Load Balancers” hyperlink from the left panel:
Click on on the “Create load balancer” button to be directed to the configuration web page:
Choose the kind of load balancer based on the necessities:
Merely click on on the “Create” button for the chosen kind of load balancer:
Kind the identify of the load balancer:
Select the VPC to be related to the load balancer and mark the checkbox for the “Availability Zones” out there within the Mappings part:
It’s required to tick not less than two of the checkboxes for the AZs:
How you can Create a Safety Group?
Scroll down the web page to find the safety teams part and click on on the “Create new safety group” hyperlink:
Kind the identify and the outline of the safety group:
Edit the Inbound guidelines by clicking on the “Add rule” button. Permit ports “8080”, “80”, “443”, and “22” to get site visitors from anyplace on the web:
Scroll all the way down to the underside of the web page to click on on the “Create safety group” button:
Head again to the Load Balancer configuration web page and choose the created safety group:
How you can Create a Goal Group?
Scroll down the web page and click on on the “Add listener” button from the Listener part:
Add HTTP listener and click on on the “Create goal group” hyperlink to open a brand new tab:
Choose the “Cases” because the goal for the load balancer:
Enter the identify of the goal group:
Scroll all the way down to broaden the “Superior well being examine settings” part to pick out the “Override” choice and sort “8080” for the port:
Click on on the “Subsequent” button from the underside of the web page:
How you can Join EC2 to Load Balancer?
Choose the EC2 occasion and supply the port quantity to incorporate the occasion as a goal group:
Scroll down the web page which comprises the chosen EC2 occasion in “Pending” standing after which click on on the “Create goal group” button:
Head again to the load balancer web page and choose the Goal group created within the earlier step:
Find the “Safe listener settings” part and supply SSL/TLS certificates:
Evaluate the configurations and click on on the “Create load balancer” button:
The load balancer has been created efficiently:
How you can Confirm the Connection With EC2 Occasion?
To confirm that the EC2 occasion is related to the load balancer, click on on the “Goal Teams” web page from the left panel:
Choose the goal group and head into the “Targets” part:
The EC2 occasion is positioned as a registered goal with port 8080 as a listener port:
This was all about connecting the EC2 occasion to the load balancer.
Conclusion
To attach EC2 to the load stability, go to the Load Balancers web page from the EC2 dashboard and choose the kind of load balancer. Configure the load balancer by offering the safety teams and listener ports to get site visitors. Configure the goal group by attaching an EC2 occasion after which add it to the load balancer. After creating the load balancer, go to the goal teams web page to confirm that the EC2 occasion is related to it. This weblog guided in regards to the technique for connecting the EC2 to load balancer.