github.com/jrasell/terraform@v0.6.17-0.20160523115548-2652f5232949/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  ```js
    20  resource "google_compute_instance_group" "test" {
    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  ```js
    29  resource "google_compute_instance_group" "webservers" {
    30    name        = "terraform-webservers"
    31    description = "Terraform test instance group"
    32  
    33    instances = [
    34      "${google_compute_instance.test.self_link}",
    35      "${google_compute_instance.test2.self_link}"
    36    ]
    37  
    38    named_port {
    39      name = "http"
    40      port = "8080"
    41    }
    42  
    43    named_port {
    44      name = "https"
    45      port = "8443"
    46    }
    47  
    48    zone = "us-central1-a"
    49  }
    50  ```
    51  
    52  ## Argument Reference
    53  
    54  The following arguments are supported:
    55  
    56  * `name` - (Required) The name of the instance group. Must be 1-63
    57      characters long and comply with
    58      [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters
    59      include lowercase letters, numbers, and hyphens.
    60  
    61  * `zone` - (Required) The zone that this instance group should be created in.
    62  
    63  - - -
    64  
    65  * `description` - (Optional) An optional textual description of the instance
    66      group.
    67  
    68  * `instances` - (Optional) List of instances in the group. They should be given
    69      as self_link URLs. When adding instances they must all be in the same
    70      network and zone as the instance group.
    71  
    72  * `named_port` - (Optional) The named port configuration. See the section below
    73      for details on configuration.
    74  
    75  * `project` - (Optional) The project in which the resource belongs. If it
    76      is not provided, the provider project is used.
    77  
    78  The `named_port` block supports:
    79  
    80  * `name` - (Required) The name which the port will be mapped to.
    81  
    82  * `port` - (Required) The port number to map the name to.
    83  
    84  ## Attributes Reference
    85  
    86  In addition to the arguments listed above, the following computed attributes are
    87  exported:
    88  
    89  * `network` - The network the instance group is in.
    90  
    91  * `self_link` - The URI of the created resource.
    92  
    93  * `size` - The number of instances in the group.