github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/google/r/compute_instance_group_manager.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_compute_instance_group_manager" 4 sidebar_current: "docs-google-compute-instance-group-manager" 5 description: |- 6 Manages an Instance Group within GCE. 7 --- 8 9 # google\_compute\_instance\_group\_manager 10 11 The Google Compute Engine Instance Group Manager 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/manager) 14 and [API](https://cloud.google.com/compute/docs/instance-groups/manager/v1beta2/instanceGroupManagers) 15 16 ## Example Usage 17 18 ```hcl 19 resource "google_compute_instance_group_manager" "foobar" { 20 name = "terraform-test" 21 description = "Terraform test instance group manager" 22 23 base_instance_name = "foobar" 24 instance_template = "${google_compute_instance_template.foobar.self_link}" 25 update_strategy = "NONE" 26 zone = "us-central1-a" 27 28 target_pools = ["${google_compute_target_pool.foobar.self_link}"] 29 target_size = 2 30 31 named_port { 32 name = "customHTTP" 33 port = 8888 34 } 35 } 36 ``` 37 38 ## Argument Reference 39 40 The following arguments are supported: 41 42 * `base_instance_name` - (Required) The base instance name to use for 43 instances in this group. The value must be a valid 44 [RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters 45 are lowercase letters, numbers, and hyphens (-). Instances are named by 46 appending a hyphen and a random four-character string to the base instance 47 name. 48 49 * `instance_template` - (Required) The full URL to an instance template from 50 which all new instances will be created. 51 52 * `name` - (Required) The name of the instance group manager. Must be 1-63 53 characters long and comply with 54 [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters 55 include lowercase letters, numbers, and hyphens. 56 57 * `zone` - (Required) The zone that instances in this group should be created 58 in. 59 60 - - - 61 62 * `description` - (Optional) An optional textual description of the instance 63 group manager. 64 65 * `named_port` - (Optional) The named port configuration. See the section below 66 for details on configuration. 67 68 * `project` - (Optional) The project in which the resource belongs. If it 69 is not provided, the provider project is used. 70 71 * `update_strategy` - (Optional, Default `"RESTART"`) If the `instance_template` 72 resource is modified, a value of `"NONE"` will prevent any of the managed 73 instances from being restarted by Terraform. A value of `"RESTART"` will 74 restart all of the instances at once. In the future, as the GCE API matures 75 we will support `"ROLLING_UPDATE"` as well. 76 77 * `target_size` - (Optional) If not given at creation time, this defaults to 1. 78 Do not specify this if you are managing the group with an autoscaler, as 79 this will cause fighting. 80 81 * `target_pools` - (Optional) The full URL of all target pools to which new 82 instances in the group are added. Updating the target pools attribute does 83 not affect existing instances. 84 85 The `named_port` block supports: (Include a `named_port` block for each named-port required). 86 87 * `name` - (Required) The name of the port. 88 89 * `port` - (Required) The port number. 90 91 ## Attributes Reference 92 93 In addition to the arguments listed above, the following computed attributes are 94 exported: 95 96 * `fingerprint` - The fingerprint of the instance group manager. 97 98 * `instance_group` - The full URL of the instance group created by the manager. 99 100 * `self_link` - The URL of the created resource.