infracost / infracost

Cloud cost estimates for Terraform in pull requestsπŸ’°πŸ“‰ Shift FinOps Left!
https://infracost.io
Apache License 2.0
10.95k stars 546 forks source link

google_container_node_pool change isn't calculated #3218

Open illmaticz opened 1 day ago

illmaticz commented 1 day ago

Hello,

Using v0.10.39

I've made machine type changes to 2 Node Pools in my tfvars under my Terraform module: terraform plan:

  # google_container_node_pool.nodes["0"] must be replaced
-/+ resource "google_container_node_pool" "nodes" {
~ node_config {
...
          ~ disk_size_gb      = 100 -> (known after apply)
          ~ disk_type         = "pd-balanced" -> (known after apply)
          ~ guest_accelerator = [] -> (known after apply)
          ~ image_type        = "COS_CONTAINERD" -> (known after apply)
          ~ local_ssd_count   = 0 -> (known after apply)
          ~ machine_type      = "n2-standard-48" -> "n1-standard-16" # forces replacement
...
# google_container_node_pool.nodes["1"] must be replaced
-/+ resource "google_container_node_pool" "nodes" {
~ node_config {
...
        name                        = "node-pool-2"
      + name_prefix                 = (known after apply)
      ~ node_count                  = 4 -> (known after apply)
      + operation                   = (known after apply)
      ~ project                     = "project" -> (known after apply)
         machine_type      = "e2-standard-4" -> "e2-standard-8" # forces replacement
      ~ version                     = "1.29.8-gke.1031000" -> (known after apply)
...
        }

In my PR with the node_pool machine type change, I create a diff from master like so:

+ git checkout master --quiet
+ infracost breakdown --path terraform/google_kubernetes_engine --terraform-var-file tfvars/dev.tfvars --format json --include-all-paths --out-file infracost-base.json --debug-report --show-skipped

+ git checkout feature/infracost_tf --quiet

+ infracost diff --path terraform/google_kubernetes_engine --terraform-var-file tfvars/dev.tfvars --compare-to infracost-base.json --include-all-paths --debug-report --show-skipped --log-level debug

Key: * usage cost, ~ changed, + added, - removed

──────────────────────────────────

Project: main-google_kubernetes_engine_development
Workspace: google_kubernetes_engine_development

~ google_container_node_pool.nodes["0"]

  $0.00 ($0.00 β†’ $0.00)

~ google_container_node_pool.nodes["1"]

  $0.00 ($0.00 β†’ $0.00)

Monthly cost change for terraform/google_kubernetes_engine (Workspace: google_kubernetes_engine_development)
Amount:  $0.00 ($95 β†’ $95)
Percent: 0%
──────────────────────────────────

Region: us-central1

Please help me understand what's the issue here. TIA!

illmaticz commented 1 day ago

Update after running infracost breakdown --path . --format=json | jq ".summary.unsupportedResourceCounts:

WARN 1 google_container_node_pool price missing across 1 resource

Is this related to the region I'm running on?