aws_autoscaling_group cost estimation
An Auto Scaling Group is free to create. Its cost is entirely the EC2 instances it launches, so the bill scales with desired_capacity times the instance type times uptime.
An aws_autoscaling_group (ASG) keeps a target number of EC2 instances running, replacing unhealthy ones and scaling in and out on demand. The ASG itself has no charge. Every dollar it produces comes from the EC2 instances it launches, plus their attached EBS volumes and any data transfer they generate.
That makes the cost driver simple but easy to underestimate: your monthly bill is roughly the number of running instances times the instance hourly rate times 730 hours. An ASG with desired_capacity of 6 running m5.large ($0.096/hour) is about $420/month in compute alone, before EBS and data transfer. The dangerous part is the max_size: a misconfigured scaling policy or a traffic spike can push the group to its ceiling, and you pay for every instance while it runs.
Cost control on an ASG is really cost control on the launch template it uses (instance type, size, and whether it launches Spot). The three biggest levers are right-sizing the instance type, using a mixed-instances policy with Spot for fault-tolerant capacity, and setting scaling policies that scale in aggressively so you are not paying for idle instances after a spike passes.
c3x prices an ASG by reading its desired_capacity and the referenced launch template or launch configuration, then costing that many instances. Point c3x at your Terraform to see the group's real monthly compute cost before you apply, and to catch an oversized instance type or an unbounded max_size early.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_autoscaling_group" "web" {
name = "web-asg"
desired_capacity = 3
min_size = 2
max_size = 10
vpc_zone_identifier = aws_subnet.private[*].id
health_check_type = "ELB"
launch_template {
id = aws_launch_template.web.id
version = "$Latest"
}
tag {
key = "Name"
value = "web"
propagate_at_launch = true
}
}Pricing dimensions
What you actually pay for when you provision aws_autoscaling_group.
| Dimension | Unit | What's being charged |
|---|---|---|
| Auto Scaling Group | free | The group, scaling policies, and lifecycle hooks have no charge. $0 |
| EC2 instances launched | per instance-hour | The real cost: desired_capacity instances at the launch template's instance type and rate. m5.large: ~$0.096/hour (~$70/mo per instance) |
| Attached EBS + data transfer | per GB-month / per GB | Each instance's root and data volumes, plus any egress the instances generate. gp3: $0.08/GB-month |
Optimization tips
Common ways to reduce aws_autoscaling_group cost without changing the workload.
Use a mixed-instances policy with Spot
Up to 90% on the Spot portionFor fault-tolerant capacity, run a baseline on-demand and the rest on Spot. This can cut the group's compute cost by 50 to 90 percent with no code change.
Right-size the launch template instance type
50% per size reductionThe group multiplies whatever instance type you pick. Dropping from m5.xlarge to m5.large across a 6-instance group halves the compute bill.
Scale in aggressively
Set target-tracking policies that remove instances quickly after load drops, so you stop paying for capacity you provisioned for a spike that has passed.
FAQ
Does an Auto Scaling Group cost money?
The group itself is free. You pay only for the EC2 instances it launches, their EBS volumes, and their data transfer. Cost scales with the number of running instances times the instance rate.
How do I estimate the cost of an Auto Scaling Group?
Multiply the desired_capacity by the instance type's hourly rate by 730 hours, then add EBS and data transfer. c3x does this automatically by reading the group and its launch template from your Terraform.
What is the most expensive mistake with an ASG?
An unbounded or very high max_size combined with an aggressive scale-out policy. A traffic spike or a bad metric can drive the group to its ceiling and bill you for every instance until it scales back in.
How can I reduce Auto Scaling Group cost?
Use a mixed-instances policy with Spot for the fault-tolerant portion, right-size the instance type in the launch template, and set scaling policies that scale in quickly after load drops.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_autoscaling_group.