Autoscaling Application with AutoScaling Groups and AWS LoadBalancer2022-07-19
Create Load Balancer:
Now that all is set, Lets setup Auto Scaling and Load Balancing for your Application.
Creating Auto Scaling Group:
Before we can create a Auto Scaling Group, we need to create a Launch Configuration (you can either use a single AMI to create a Launch Configuration or use Launch Templates.). You can do this by choosing Launch Configuration in AUTO SCALING section on your left-side menu, Click on Create Launch Configuration and choose your previously created AMI, Instance Type and Instance Settings like Security Groups and Storage Settings etc., and complete creation of Launch Configuration.
Testing Auto Scaling Group:
Based on whether you selected CPU Average or Average Network In/Out or Load Balancer Request Count per target. Create a suitable load and check your AWS EC2 instance count increasing and they being Auto Added to your Load Balance Target Group.
Note: If you create a classic Load Balancer, then you will be asked to select the Load Balancer, If you created a Network/Application Load Balancer, you will be asked to choose a Target Group During Creation of Auto Scaling Group.