Data Source: aws_vpc_ipam_pool

aws_vpc_ipam_pool provides details about an IPAM pool.

This resource can prove useful when an ipam pool was created in another root module and you need the pool's id as an input variable. For example, pools can be shared via RAM and used to create vpcs with CIDRs from that pool.

Example Usage

The following example shows an account that has only 1 pool, perhaps shared via RAM, and using that pool id to create a VPC with a CIDR derived from AWS IPAM.

data "aws_vpc_ipam_pool" "test" {
  filter {
    name   = "description"
    values = ["*test*"]
  }

  filter {
    name   = "address-family"
    values = ["ipv4"]
  }
}

resource "aws_vpc" "test" {
  ipv4_ipam_pool_id   = data.aws_vpc_ipam_pool.test.id
  ipv4_netmask_length = 28
}

Argument Reference

The arguments of this data source act as filters for querying the available VPCs in the current region. The given filters must match exactly one VPC whose data will be exported as attributes.

filter

Attribute Reference

All of the argument attributes except filter blocks are also exported as result attributes. This data source will complete the data by populating any fields that are not included in the configuration with the data for the selected VPC.

The following attribute is additionally exported:

Timeouts

Configuration options: