github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/google/d/google_compute_zones.html.markdown (about)

     1  ---
     2  layout: "google"
     3  page_title: "Google: google_compute_zones"
     4  sidebar_current: "docs-google-datasource-compute-zones"
     5  description: |-
     6    Provides a list of available Google Compute zones
     7  ---
     8  
     9  # google\_compute\_zones
    10  
    11  Provides access to available Google Compute zones in a region for a given project.
    12  See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/regions-zones) in the upstream docs.
    13  
    14  ```
    15  data "google_compute_zones" "available" {}
    16  
    17  resource "google_compute_instance_group_manager" "foo" {
    18    count = "${length(data.google_compute_zones.available.names)}"
    19  
    20    name               = "terraform-test-${count.index}"
    21    instance_template  = "${google_compute_instance_template.foobar.self_link}"
    22    base_instance_name = "foobar-${count.index}"
    23    zone               = "${data.google_compute_zones.available.names[count.index]}"
    24    target_size        = 1
    25  }
    26  ```
    27  
    28  ## Argument Reference
    29  
    30  The following arguments are supported:
    31  
    32  * `region` (Optional) - Region from which to list available zones. Defaults to region declared in the provider.
    33  * `status` (Optional) - Allows to filter list of zones based on their current status. Status can be either `UP` or `DOWN`.
    34    Defaults to no filtering (all available zones - both `UP` and `DOWN`).
    35  
    36  ## Attributes Reference
    37  
    38  The following attribute is exported:
    39  
    40  * `names` - A list of zones available in the given region