google_compute_image

Get information about a Google Compute Image. Check that your service account has the compute.imageUser role if you want to share custom images from another project. If you want to use public images, do not forget to specify the dedicated project. For more information see the official documentation and its API.

Example Usage

data "google_compute_image" "my_image" {
  family  = "debian-11"
  project = "debian-cloud"
}

resource "google_compute_instance" "default" {
  # ...

  boot_disk {
    initialize_params {
      image = data.google_compute_image.my_image.self_link
    }
  }
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported: