https://infracost.io logo
#help
Title
# help
a

ancient-jewelry-73631

08/07/2023, 4:56 PM
hey all - what is the best way to deal with autoscaling calculations? there is, of course, a big difference in cost between running 1 t3.xlarge instance and running 10 of them. Specifying a value for the “MaxSize” setting in the
aws:autoscaling:asg
namespace doesn’t seem to help:
Copy code
{
      namespace = "aws:autoscaling:asg",
      name      = "MaxSize",
      value     = var.autoscaling_max_size,
      resource  = ""
    },
b

busy-agent-35515

08/07/2023, 5:22 PM
Hello! Could you please explain what you’re trying to accomplish? Or what is the problem? :)
a

ancient-jewelry-73631

08/07/2023, 5:26 PM
hey Vadim! Let’s say I’m expecting higher traffic, so I would increase the MaxSize for my autoscaling group from 2 to 5. Looks like right now infracost won’t detect this change that could potentially increase my cloud costs - it would simply say there’s no difference. If I want to see how much it could potentially cost me to run 5 instances instead of 2, I would have to increase the MinSize to 5 as well
I’m honestly not sure how I would handle this scenario of the cost increasing potentially if the autoscaling action occurs
b

busy-agent-35515

08/07/2023, 6:21 PM
Can you try setting infracost-usage.yml file with the following?
Copy code
version: 0.1
resource_usage:
  aws_autoscaling_group.<CHANGE ME>:
    instances: 15 # Number of instances in the autoscaling group.
And then try running
infracost breakdown --path=. --usage-file=infracost-usage.yml
a

ancient-jewelry-73631

08/07/2023, 6:36 PM
I’ll give that a try on another project later where autoscaling groups are already provisioned. This was for a new project
I’d need to provide an asg name instead <CHANGE ME>, right?
b

busy-agent-35515

08/07/2023, 6:37 PM
Correct
This is a usage mapping to your resources
47 Views