hey all - what is the best way to deal with autosc...
# help
a
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
Hello! Could you please explain what you’re trying to accomplish? Or what is the problem? :)
a
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
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
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
Correct
This is a usage mapping to your resources