github.com/tomaszheflik/terraform@v0.7.3-0.20160827060421-32f990b41594/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 ## Example Usage 16 17 ``` 18 # Declare the data source 19 data "aws_availability_zones" "available" {} 20 21 # e.g. Create subnets in the first two available availability zones 22 23 resource "aws_subnet" "primary" { 24 availability_zone = "${data.aws_availability_zones.available.names[0]}" 25 26 # Other properties... 27 } 28 29 resource "aws_subnet" "secondary" { 30 availability_zone = "${data.aws_availability_zones.available.names[1]}" 31 32 # Other properties... 33 } 34 ``` 35 36 ## Argument Reference 37 38 The following arguments are supported: 39 40 * `state` - (Optional) Allows to filter list of Availability Zones based on their 41 current state. Can be either `"available"`, `"information"`, `"impaired"` or 42 `"unavailable"`. By default the list includes a complete set of Availability Zones 43 to which the underlying AWS account has access, regardless of their state. 44 45 ## Attributes Reference 46 47 The following attributes are exported: 48 49 * `names` - A list of the Availability Zone names available to the account.