FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_availability_zones

The Availability Zones data source allows access to the list of AWS Availability Zones which can be accessed by an AWS account within the region configured in the provider.

This is different from the aws_availability_zone (singular) data source, which provides some details about a specific availability zone.

Example Usage

# Declare the data source
data "aws_availability_zones" "available" {}

# e.g. Create subnets in the first two available availability zones

resource "aws_subnet" "primary" {
  availability_zone = "${data.aws_availability_zones.available.names[0]}"

  # Other properties...
}

resource "aws_subnet" "secondary" {
  availability_zone = "${data.aws_availability_zones.available.names[1]}"

  # Other properties...
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:


See the source of this document at Terraform.io