Data Source: aws_vpc_peering_connections

Use this data source to get IDs of Amazon VPC peering connections To get more details on each connection, use the data resource aws_vpc_peering_connection

Note: To use this data source in a count, the resources should exist before trying to access the data source, as noted in issue 4149

Example Usage

# Declare the data source
data "aws_vpc_peering_connections" "pcs" {
  filter {
    name   = "requester-vpc-info.vpc-id"
    values = [aws_vpc.foo.id]
  }
}

# get the details of each resource
data "aws_vpc_peering_connection" "pc" {
  count = length(data.aws_vpc_peering_connections.pcs.ids)
  id    = data.aws_vpc_peering_connections.pcs.ids[count.index]
}

Argument Reference

The arguments of this data source act as filters for querying the available VPC peering connections.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

Attribute Reference

All of the argument attributes except filter are also exported as result attributes.

Timeouts

Configuration options: