Resource: aws_vpc_ipam

Provides an IPAM resource.

Example Usage

Basic usage:

data "aws_region" "current" {}

resource "aws_vpc_ipam" "main" {
  description = "My IPAM"
  operating_regions {
    region_name = data.aws_region.current.name
  }

  tags = {
    Test = "Main"
  }
}

Shared with multiple operating_regions:

resource "aws_vpc_ipam" "main" {
  description = "multi region ipam"
  dynamic operating_regions {
    for_each = local.all_ipam_regions
    content {
      region_name = operating_regions.value
    }
  }
}

data "aws_region" "current" {}

variable "ipam_regions" {
  type    = list
  default = ["us-east-1", "us-west-2"]
}

locals {
  # ensure current provider region is an operating_regions entry
  all_ipam_regions = distinct(concat([data.aws_region.current.name], var.ipam_regions))
}

Argument Reference

This resource supports the following arguments:

operating_regions

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 id. For example:

import {
  to = aws_vpc_ipam.example
  id = "ipam-0178368ad2146a492"
}

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

% terraform import aws_vpc_ipam.example ipam-0178368ad2146a492