Hi Guy’s Welcome to Proto Coders Point, In this Article let’s us learn about AWS Auto Scaling Group.
Introduction to AWS ASG Service
Amazon Web Services (AWS) offers a set of tools & services to ensure applications remain scalable, Highly Available & very cost-efficient. Out of the list of AWS Services, we have one of the core features called Auto Scaling Groups (ASG). With the help of ASG, we can make our application be available to each and every user or visitor of our application using AWS we can automatically adjust the number of Amazon EC2 instances or lambda function or other application server to fulfill the requirement as per the demand, minimizing manual effort of creating server when require or deleting them when not required and this also help’s in optimizing performance and cost.
This Quick guide covers what AWS Auto Scaling Group is, its key benefits, and how to set it up step-by-step using the AWS Management Console.
Video Tutorial on AWS Auto Scaling Group
What is an AWS Auto Scaling Group?
An Auto Scaling Group (ASG) is a logical or configured group of EC2 instances or other application server’s that are managed together for automatic scaling and health checks. This ASG service on AWS enable’s by ensures that the number of instances/servers of your application matches the defined minimum and maximum capacity based on traffic or load.
Auto Scaling supports:
- Automatic instance launch and termination
- Load balancing integration (Elastic Load Balancer)
- Health checks and automatic replacement
- Scheduled and dynamic scaling
Benefits of Using Auto Scaling Group
- High Availability: Ensures the application remains available by replacing unhealthy instances.
- Cost Optimization: Automatically scales down during low usage, reducing costs.
- Elasticity: Handles traffic spikes by scaling out automatically.
- Automation: Reduces the need for manual intervention in managing instances.
- Resilience: Automatically replaces failed instances with healthy ones.
Step-by-Step: How to Set Up AWS Auto Scaling Group
From here we’ll walk through how to create an Auto Scaling Group from scratch using the AWS Console.
Step 1: Launch Template Creation
Firstly before setting up our Auto Scaling Group, we need to define how your instances will be launched, using a Launch Template inside EC2 service. Basically Launch Template will have you application been setup inside the instance, so when ASG auto scale as required the pre-defined EC2 instance will be launched to handle the traffic.
- Go to the EC2 Dashboard
Open the AWS Management Console.
Navigate to EC2 under “Compute”. - Create a Launch Template
On the left panel, select Launch Templates > Create launch template. - Fill in the following details to create ec2 launch template:
- Name:
my-launch-template
- AMI ID: Choose the Amazon Machine Image (e.g., Amazon Linux 2)
- Instance Type: e.g.,
t2.micro
(free tier if practicing aws) - Key Pair: Select/Create a new key pair to SSH/Connect into the instance.
- Security Group: Choose or create a security group (allow HTTP/SSH port 80 as needed)
- Leave other settings as default or customize based on your needs.
- Click Create launch template
- Name:


Step 2: Create Auto Scaling Group
- Navigate to Auto Scaling Groups
In the EC2 dashboard, on the left panel, Scroll down and click on Auto Scaling Groups
Click Create Auto Scaling Group - Basic Configuration
Name:my-auto-scaling-group
Launch Template: Choose the one you created earlier (my-launch-template
) - Network and Subnet Settings
Choose your VPC
Select Subnets in at least two Availability Zones for high availability, I suggest all the visible VPC from the List. - Configure Instance Options
Optionally attach a Load Balancer (Application Load Balancer or Network Load Balancer) to distribute traffic. - Set Group Size
Desired capacity: Number of instances to start with (e.g.,1
)
Minimum capacity:1
Maximum capacity:3
This means it can scale from 1 to 3 instances based on demand and traffic. - Configure Scaling Policies
Choose Target tracking scaling policy
Metric: Average CPU Utilization Target value: e.g50%
This will maintain the average CPU utilization around 50% by launching or terminating instances. - Review and Create
Review all settings and click Create Auto Scaling Group




Step 3: Test the Auto Scaling Group
With above steps we have successfully created our own Auto Scaling Group with EC2 instance, Now your ASG will start with one instance (as per desired capacity was set to 1). You can now test if it scales automatically for this we need to create a fake load on the one instance so that once it reach 50% of CPU Capacity it automatically create or scale up with another EC2 instance to manage the load.
Testing Options:
- Increase Load: Run a CPU stress tool (e.g.,
stress
) on the instance to trigger scaling. - Change Desired Capacity: Manually adjust desired capacity in ASG settings to see new instances being launched.
- Terminate Instance: Manually stop an instance. ASG will detect and replace it automatically.
Below Image I am creating a Fake load on Ec2 instance CPU.

Image Showing CPU Utilication reach above 50 percentage once i run stress cmd

The below Screenshot shows cloudwatch alarm was triggered ASG to auto Scale as CPU utilization was above 50 percentage for more then 3 minutes

Due to load on CPU below screenshot show’s that another instance got created automatically by ASG.

Step 4: Monitor and Manage ASG
You can manage and monitor your ASG from the EC2 Console:
- Instances tab: Shows currently running instances.
- Activity tab: Shows all scaling activities (launch, terminate).
- Monitoring: Integrates with Amazon CloudWatch for metrics and alarms.
You can also schedule scaling actions:
- Set rules to scale up/down based on time (e.g., scale up at 9 AM, scale down at 7 PM).
Best Practices for Auto Scaling
- Use CloudWatch Alarms to create custom metrics for scaling.
- Distribute across multiple AZs for high availability.
- Test your scaling policies under simulated load before going live.
- Monitor logs and metrics to optimize the threshold values.
- Use Lifecycle Hooks for custom actions during scale-in/scale-out (e.g., draining connections before termination).
Conclusion
AWS Auto Scaling Groups are essential for building scalable, resilient, and cost-effective cloud-native applications. By following the step-by-step approach above, you can configure and manage an ASG in a few minutes using the AWS Console.
It not only reduces operational overhead but also ensures your application can handle varying traffic efficiently. Whether you’re running a web server, backend APIs, or microservices, integrating Auto Scaling is a smart move toward a more dynamic infrastructure.