github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/google/r/compute_instance_group.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_compute_instance_group" 4 sidebar_current: "docs-google-compute-instance-group" 5 description: |- 6 Manages an Instance Group within GCE. 7 --- 8 9 # google\_compute\_instance\_group 10 11 The Google Compute Engine Instance Group API creates and manages pools 12 of homogeneous Compute Engine virtual machine instances from a common instance 13 template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/#unmanaged_instance_groups) 14 and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroups) 15 16 ## Example Usage 17 18 ### Empty instance group 19 20 ```hcl 21 resource "google_compute_instance_group" "test" { 22 name = "terraform-test" 23 description = "Terraform test instance group" 24 zone = "us-central1-a" 25 } 26 ``` 27 28 ### With instances and named ports 29 30 ```hcl 31 resource "google_compute_instance_group" "webservers" { 32 name = "terraform-webservers" 33 description = "Terraform test instance group" 34 35 instances = [ 36 "${google_compute_instance.test.self_link}", 37 "${google_compute_instance.test2.self_link}", 38 ] 39 40 named_port { 41 name = "http" 42 port = "8080" 43 } 44 45 named_port { 46 name = "https" 47 port = "8443" 48 } 49 50 zone = "us-central1-a" 51 } 52 ``` 53 54 ## Argument Reference 55 56 The following arguments are supported: 57 58 * `name` - (Required) The name of the instance group. Must be 1-63 59 characters long and comply with 60 [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters 61 include lowercase letters, numbers, and hyphens. 62 63 * `zone` - (Required) The zone that this instance group should be created in. 64 65 - - - 66 67 * `description` - (Optional) An optional textual description of the instance 68 group. 69 70 * `instances` - (Optional) List of instances in the group. They should be given 71 as self_link URLs. When adding instances they must all be in the same 72 network and zone as the instance group. 73 74 * `named_port` - (Optional) The named port configuration. See the section below 75 for details on configuration. 76 77 * `project` - (Optional) The project in which the resource belongs. If it 78 is not provided, the provider project is used. 79 80 The `named_port` block supports: 81 82 * `name` - (Required) The name which the port will be mapped to. 83 84 * `port` - (Required) The port number to map the name to. 85 86 ## Attributes Reference 87 88 In addition to the arguments listed above, the following computed attributes are 89 exported: 90 91 * `network` - The network the instance group is in. 92 93 * `self_link` - The URI of the created resource. 94 95 * `size` - The number of instances in the group.