github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/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 There are no arguments for this data source. 39 40 ## Attributes Reference 41 42 The following attributes are exported: 43 44 * `names` - A list of the availability zone names available to the account.