github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/d/availability_zones.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_availability_zones"
     4  sidebar_current: "docs-aws-datasource-availability-zones"
     5  description: |-
     6      Provides a list of Availability Zones which can be used by an AWS account.
     7  ---
     8  
     9  # aws\_availability\_zones
    10  
    11  The Availability Zones data source allows access to the list of AWS
    12  Availability Zones which can be accessed by an AWS account within the region
    13  configured in the provider.
    14  
    15  This is different from the `aws_availability_zone` (singular) data source,
    16  which provides some details about a specific availability zone.
    17  
    18  ## Example Usage
    19  
    20  ```hcl
    21  # Declare the data source
    22  data "aws_availability_zones" "available" {}
    23  
    24  # e.g. Create subnets in the first two available availability zones
    25  
    26  resource "aws_subnet" "primary" {
    27    availability_zone = "${data.aws_availability_zones.available.names[0]}"
    28  
    29    # ...
    30  }
    31  
    32  resource "aws_subnet" "secondary" {
    33    availability_zone = "${data.aws_availability_zones.available.names[1]}"
    34  
    35    # ...
    36  }
    37  ```
    38  
    39  ## Argument Reference
    40  
    41  The following arguments are supported:
    42  
    43  * `state` - (Optional) Allows to filter list of Availability Zones based on their
    44  current state. Can be either `"available"`, `"information"`, `"impaired"` or
    45  `"unavailable"`. By default the list includes a complete set of Availability Zones
    46  to which the underlying AWS account has access, regardless of their state.
    47  
    48  ## Attributes Reference
    49  
    50  The following attributes are exported:
    51  
    52  * `names` - A list of the Availability Zone names available to the account.