Resource: aws_vpc_ipam_pool

Provides an IP address pool resource for IPAM.

Example Usage

Basic usage:

data "aws_region" "current" {}

resource "aws_vpc_ipam" "example" {
  operating_regions {
    region_name = data.aws_region.current.name
  }
}

resource "aws_vpc_ipam_pool" "example" {
  address_family = "ipv4"
  ipam_scope_id  = aws_vpc_ipam.example.private_default_scope_id
  locale         = data.aws_region.current.name
}

Nested Pools:

data "aws_region" "current" {}

resource "aws_vpc_ipam" "example" {
  operating_regions {
    region_name = data.aws_region.current.name
  }
}

resource "aws_vpc_ipam_pool" "parent" {
  address_family = "ipv4"
  ipam_scope_id  = aws_vpc_ipam.example.private_default_scope_id
}

resource "aws_vpc_ipam_pool_cidr" "parent_test" {
  ipam_pool_id = aws_vpc_ipam_pool.parent.id
  cidr         = "172.20.0.0/16"
}

resource "aws_vpc_ipam_pool" "child" {
  address_family      = "ipv4"
  ipam_scope_id       = aws_vpc_ipam.example.private_default_scope_id
  locale              = data.aws_region.current.name
  source_ipam_pool_id = aws_vpc_ipam_pool.parent.id
}


resource "aws_vpc_ipam_pool_cidr" "child_test" {
  ipam_pool_id = aws_vpc_ipam_pool.child.id
  cidr         = "172.20.0.0/24"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import IPAMs using the IPAM pool id. For example:

import {
  to = aws_vpc_ipam_pool.example
  id = "ipam-pool-0958f95207d978e1e"
}

Using terraform import, import IPAMs using the IPAM pool id. For example:

% terraform import aws_vpc_ipam_pool.example ipam-pool-0958f95207d978e1e