Day-25: Auto Scaling Groups (ASG)
🔹 What is Auto Scaling?
Auto Scaling automatically adjusts the number of EC2 instances in your application based on demand, ensuring:
- High availability,
- Performance efficiency, and
- Cost optimization.
It helps you add instances when traffic increases and remove instances when traffic decreases.
🔹 Key Components
- Launch Template / Launch Configuration – Defines the instance type, AMI, key pair, security groups, etc.
- Auto Scaling Group (ASG) – A collection of EC2 instances managed together.
- Scaling Policies – Rules to decide when to scale in/out.
- CloudWatch Alarms – Used to trigger scaling actions based on metrics like CPU utilization or network load.
🔹 How It Works
- You define minimum, maximum, and desired number of EC2 instances.
- Based on CloudWatch metrics or schedules, AWS automatically:
- Scales out (adds instances) when demand rises.
- Scales in (terminates instances) when demand drops.
🔹 Types of Scaling