Skip to content

Data Source: aws_vpcs#

Provides a list of VPC IDs.

Example usage#

Basic example#

The following example retrieves a list of VPC IDs with a custom service tag set to production.

data "aws_vpcs" "foo" {
  tags = {
    service = "production"
  }
}

output "foo" {
  value = data.aws_vpcs.foo.ids
}

Argument reference#

  • filter - (Optional, Block) One or more name/value pairs to use as filters.
  • tags - (Optional, Map of strings) Key-value pairs. Must exactly match pairs on the required resources.

filter#

  • name - (Required, String) The name of the filter.
    • Constraints: Filter names are case-sensitive
  • values - (Required, List of strings) One or more filter values.
    • Constraints: Filter values are case-sensitive

Attribute reference#

Provides a list of VPC IDs in a region.

  • id - (String) The region.
    • Example: ru-spb
  • ids - (List of strings) The list of VPC IDs found.