Hello, I am using Infracost with Terraform + GCE. ...
# help
s
Hello, I am using Infracost with Terraform + GCE. When I run infracost (latest version), I am getting the following logs:
Copy code
time="2023-01-27T17:08:37Z" level=info msg="Starting: Retrieving cloud prices to calculate costs"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_worker[\"worker\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_worker[\"worker2\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_master[\"master\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_worker[\"worker\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_bastion[\"bastion\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_worker[\"worker2\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_bastion[\"bastion\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
time="2023-01-27T17:08:37Z" level=warning msg="No prices found for google_compute_instance.k8s_master[\"master\"] Instance usage (Linux/UNIX, on-demand, c2d-highcpu-2), using 0.00"
Why it can’t find the price of
c2d-highcpu-2
?
c
Hi Cédric, any chance you can share a sanitized version of the block that is causing the error (including provider region, etc…)? Something simple like what we use in our test cases makes it a lot easier to debug.
s
Sure:
Copy code
resource "google_compute_instance" "debug" {
  name = "debug"
  machine_type   = "c2d-highcpu-2"
  zone           = "europe-west1-b"
  enable_display = true

  tags = ["k8s-cluster", "k8s-lb"]

  boot_disk {
    initialize_params {
      image = "ubuntu-2004-lts"
      size  = 30
    }
  }

  network_interface {
    network    = google_compute_network.vpc_net.name
    subnetwork = google_compute_subnetwork.vpc_subnet.name
  }

  metadata = {
    ssh-keys = <<EOF
      ubuntu:${var.ssh_public}
    EOF
  }

  service_account {
    email  = google_service_account.instance_sa.email
    scopes = ["cloud-platform"]
  }
}
c
Cool that works. I will create a github issue and paste the link here so you can follow the progress
s
Ok, it works with
f1-micro
but not with
c2d-highcpu-2
.
c