This message was deleted.
# general
b
This message was deleted.
b
Hello! Interesting, it seems like it is set to default only when
instanceType == ""
. Will you be able to provide a TF example?
f
Copy code
# module.eks.module.node_groups.random_pet.node_groups["new-infracost-od-test"] will be created
  + resource "random_pet" "node_groups" {
      + id        = (known after apply)
      + keepers   = {
          + "ami_type"                  = "AL2_x86_64"
          + "capacity_type"             = "ON_DEMAND"
          + "iam_role_arn"              = "arn:aws:iam::*******:role/******"
          + "instance_type"             = "c6a.xlarge"
          + "key_name"                  = "infracost_qa"
          + "node_group_name"           = "test-new-infracost-od-test"
          + "source_security_group_ids" = ""
          + "subnet_ids"                = "***********"
        }
      + length    = 2
      + separator = "-"
    }
Above is relevant section from tf plan. I added a new nodegroup with c6a.xlarge instance but Infracost shows that it is adding t3.medium instance type
Also adding relevant section of launch template TF plan:
Copy code
# module.eks.module.node_groups.aws_launch_template.nodegroup["new-infracost-od-test"] will be created
  + resource "aws_launch_template" "nodegroup" {
      + arn                     = (known after apply)
      + default_version         = (known after apply)
      + disable_api_termination = false
      + ebs_optimized           = "true"
      + id                      = (known after apply)
      + instance_type           = "c6a.xlarge"
      + key_name                = "infracost_qa"
      + latest_version          = (known after apply)
      + name                    = (known after apply)
b
Thank you! So if I understand correctly you're using a launch template with the node group, and apparently Infracost doesn't detect it and defaults to medium type. Let me try to replicate this behavior
f
Thats correct
Also, even if my managed node group is using SPOT, infracost shows it as 'Ondemand' in the output, is that expected?
Does it look similar to your case?
f
So it shows correct cost breakdown for existing infra nodegroup instance types but moment you add a new nodegroup OR change the instance type of existing nodegroup, instance type is calculated as t3.medium as part of infradiff command
b
I see, good clarification, thank you 👍 W/r/t spot pricing: I haven't added the resource, so I'm not sure about the answer, please let me take a look and I'll come back to you
f
Thanks a lot Vadim for quick response, appreciated!!
b
Sure thing 🙂 Quick update: we support spot pricing on launch template derived from the autoscaling group attributes. I would guess this is not detected like the instance type. Hard to say what's happening as I can't reproduce it 😕
m
hmm @future-butcher-9053 I can’t reproduce this our side, could I ask that you provide us the raw HCL that you’re using to create these resources (not just the plan output). This can help us debug. As things like dynamic blocks, references and or module inputs can cause things to go awry
f
Hi Hugo, are you asking for actual TF script here?
m
The actual terraform blocks that generate these resources
With any sensitive information redacted