QA
Beginner LevelCloud Computing (AWS/GCP/Azure)

What is an AWS Auto Scaling Group (ASG) and how do Target Tracking Scaling Policies work?

❓ Interview Prompt: Explain EC2 Auto Scaling Groups, Min/Max/Desired capacity settings, health check replacements, and scaling policy types.

An EC2 Auto Scaling Group (ASG) maintains application availability by automatically launching or terminating EC2 instances according to application load.

Core Components:

•
Min / Max / Desired Capacity: Sets floor, ceiling, and target number of EC2 instances (e.g. Min: 2, Desired: 4, Max: 20).
•
Health Check Replacements: Automatically terminates unhealthy instances (failing EC2 status or ALB health checks) and launches fresh replacements.

Scaling Policy Types:

1
Target Tracking Scaling: Automatically adjusts instance counts to maintain a specific metric (e.g. "Keep average fleet CPU utilization at 70%").
2
Step Scaling: Increases instance count in steps based on CloudWatch alarm thresholds (e.g. +2 instances if CPU > 80%).
3
Scheduled Scaling: Scales capacity based on predictable calendar events.

Code Implementation Example

hcl
# Target tracking scaling policy maintaining 70% CPU
resource "aws_autoscaling_policy" "cpu_target" {
  name                   = "target-tracking-cpu70"
  autoscaling_group_name = aws_autoscaling_group.app_asg.name
  policy_type            = "TargetTrackingScaling"

  target_tracking_configuration {
    predefined_metric_specification {
      predefined_metric_type = "ASGAverageCPUUtilization"
    }
    target_value = 70.0 # Maintain 70% average CPU
  }
}
💡Terraform target tracking scaling policy for EC2 Auto Scaling Group.
🎯 Interview Key Takeaway

Auto Scaling Groups maintain fleet availability and adjust EC2 capacity to match CPU or traffic target tracking metrics.

#Auto Scaling#ASG#EC2#Elasticity#Beginner
Back to all Cloud Computing (AWS/GCP/Azure) Questions→

More Cloud Computing (AWS/GCP/Azure) Interview Questions

Beginner LevelCloud Computing (AWS/GCP/Azure)

How does Serverless Architecture (AWS Lambda / GCP Cloud Run) handle Auto-Scaling and Cold Starts?

Beginner LevelCloud Computing (AWS/GCP/Azure)

What is the difference between IaaS, PaaS, and SaaS cloud service models?

Beginner LevelCloud Computing (AWS/GCP/Azure)

What is AWS EC2 and what are On-Demand, Reserved, and Spot Instance pricing models?