github.com/xsb/terraform@v0.6.13-0.20160314145438-fe415c2f09d7/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-groups)
    14  and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroups)
    15  
    16  ## Example Usage
    17  
    18  Empty instance group
    19  ```
    20  resource "google_compute_instance_group" "foobar" {
    21  	name = "terraform-test"
    22  	description = "Terraform test instance group"
    23  	zone = "us-central1-a"
    24  }
    25  ```
    26  
    27  With instances and named ports
    28  ```
    29  resource "google_compute_instance_group" "foobar" {
    30  	name = "terraform-test"
    31  	description = "Terraform test instance group"
    32  	instances = [ 
    33  	              "${google_compute_instance.test.self_link}", 
    34  	              "${google_compute_instance.test2.self_link}"
    35  	            ]
    36  	named_port {
    37  		name = "http"
    38  		port = "8080"
    39  	}
    40  	named_port {
    41  		name = "https"
    42  		port = "8443"
    43  	}
    44  	zone = "us-central1-a"
    45  }
    46  ```
    47  
    48  ## Argument Reference
    49  
    50  The following arguments are supported:
    51  
    52  * `name` - (Required) The name of the instance group. Must be 1-63
    53  characters long and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
    54  Supported characters include lowercase letters, numbers, and hyphens.
    55  
    56  * `description` - (Optional) An optional textual description of the instance
    57    group.
    58  
    59  * `instances` - (Optional) List of instances in the group. They should be given as
    60    self_link URLs. When adding instances they must all be in the same network and 
    61    zone as the instance group.
    62  
    63  * `named_port` - (Optional) Named ports are key:value pairs that represent a 
    64    service name and the port number that the service runs on. The key:value pairs 
    65    are simple metadata that the Load Balancing service can use. This can specified 
    66    multiple times
    67  
    68  * `zone` - (Required) The zone that this instance group should be created in.
    69  
    70  The `named_port` block supports:
    71  
    72  * `name` - The name which the port will be mapped to.
    73  
    74  * `port` - The port number to map the name to.
    75  
    76  ## Attributes Reference
    77  
    78  The following attributes are exported:
    79  
    80  * `network` - The network the instance group is in.
    81  
    82  * `size` - The number of instances in the group.
    83  
    84  * `self_link` - The URL of the created resource.