FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

google_compute_instance_group

The Google Compute Engine Instance Group API creates and manages pools of homogeneous Compute Engine virtual machine instances from a common instance template. For more information, see the official documentation and API

Example Usage

Empty instance group

resource "google_compute_instance_group" "test" {
  name        = "terraform-test"
  description = "Terraform test instance group"
  zone        = "us-central1-a"
}

With instances and named ports

resource "google_compute_instance_group" "webservers" {
  name        = "terraform-webservers"
  description = "Terraform test instance group"

  instances = [
    "${google_compute_instance.test.self_link}",
    "${google_compute_instance.test2.self_link}"
  ]

  named_port {
    name = "http"
    port = "8080"
  }

  named_port {
    name = "https"
    port = "8443"
  }

  zone = "us-central1-a"
}

Argument Reference

The following arguments are supported:


The named_port block supports:

Attributes Reference

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


See the source of this document at Terraform.io