Data Source: aws_regions

Provides information about AWS Regions. Can be used to filter regions i.e., by Opt-In status or only regions enabled for current account. To get details like endpoint and description of each region the data source can be combined with the aws_region data source.

Example Usage

Enabled AWS Regions:

data "aws_regions" "current" {}

All the regions regardless of the availability

data "aws_regions" "current" {
  all_regions = true
}

To see regions that are filtered by "not-opted-in", the all_regions argument needs to be set to true or no results will be returned.

data "aws_regions" "current" {
  all_regions = true

  filter {
    name   = "opt-in-status"
    values = ["not-opted-in"]
  }
}

Argument Reference

This data source supports the following arguments:

filter Configuration Block

The filter configuration block supports the following arguments:

Attribute Reference

This data source exports the following attributes in addition to the arguments above: