Skip to content

appvia/terraform-aws-ipam

Github Actions

Terraform AWS IPAM

Description

This module creates an AWS IAPM configuration, IPv4 pools and optionally shares them via AWS Resource Access Manager (RAM).

Usage

Add example usage here

module "example" {
  source  = "appvia/ipam/aws"
  version = "1.0.0"

  name        = "core"
  description = "Core IPAM network"

  # List of operating regions for this IPAM
  regions = [
    "eu-west-2",
  ]

  # Configure root IPAM pools
  ipv4_root_pools = {
    core = {
      cidr        = "10.0.0.0/8"
      description = "Core network IPv4 allocation pool"
    }
  }

  # Configure region IPAM pools
  ipv4_regional_pools = {
    eu-west-2 = {
      parent         = "core"
      netmask_length = 8
      locale         = "eu-west-2"
    }
  }

  # Configure workload level IPAM pools
  ipv4_ou_pools = {
    production = {
      parent      = "eu-west-2"
      cidr        = "10.0.0.0/16"
      description = "Production"

      ram_share_principals = [
        "arn:aws:organizations::012345678910:organization/o-skf6elds82",
      ]
    }
  }
}

Update Documentation

The terraform-docs utility is used to generate this README. Follow the below steps to update:

  1. Make changes to the .terraform-docs.yml file
  2. Fetch the terraform-docs binary (https://terraform-docs.io/user-guide/installation/)
  3. Run terraform-docs markdown table --output-file ${PWD}/README.md --output-mode inject .

Requirements

Name Version
terraform >= 1.6
aws >= 5

Providers

Name Version
aws >= 5

Modules

No modules.

Resources

Name Type
aws_ram_principal_association.ipam_ou resource
aws_ram_principal_association.ipam_regional resource
aws_ram_principal_association.ipam_root resource
aws_ram_resource_association.ipam_ou resource
aws_ram_resource_association.ipam_regional resource
aws_ram_resource_association.ipam_root resource
aws_ram_resource_share.ipam_ou resource
aws_ram_resource_share.ipam_regional resource
aws_ram_resource_share.ipam_root resource
aws_vpc_ipam.this resource
aws_vpc_ipam_pool.ipv4_ou resource
aws_vpc_ipam_pool.ipv4_regional resource
aws_vpc_ipam_pool.ipv4_root resource
aws_vpc_ipam_pool_cidr.ipv4_ou resource
aws_vpc_ipam_pool_cidr.ipv4_regional resource
aws_vpc_ipam_pool_cidr.ipv4_root resource
aws_region.current data source

Inputs

Name Description Type Default Required
description Description of the IPAM configuration string null no
ipv4_ou_pools Organisational unit level IPv4 IPAM pools
map(object({
parent = string
cidr = optional(string)
netmask_length = optional(number)
description = optional(string)
allocation_default_netmask_length = optional(number)
allocation_max_netmask_length = optional(number)
allocation_min_netmask_length = optional(number)
allocation_resource_tags = optional(map(string))
auto_import = optional(bool, true)
locale = optional(string)
tags = optional(map(string), {})
ram_share_principals = optional(list(string), [])
}))
{} no
ipv4_regional_pools Regional level IPv4 IPAM pools
map(object({
parent = string
cidr = optional(string)
netmask_length = optional(number)
description = optional(string)
allocation_default_netmask_length = optional(number)
allocation_max_netmask_length = optional(number)
allocation_min_netmask_length = optional(number)
allocation_resource_tags = optional(map(string))
auto_import = optional(bool, true)
locale = optional(string)
tags = optional(map(string), {})
ram_share_principals = optional(list(string), [])
}))
{} no
ipv4_root_pools Top level IPv4 IPAM pools
map(object({
cidr = optional(string)
description = optional(string)
allocation_default_netmask_length = optional(number)
allocation_max_netmask_length = optional(number)
allocation_min_netmask_length = optional(number)
allocation_resource_tags = optional(map(string))
auto_import = optional(bool, true)
locale = optional(string)
tags = optional(map(string), {})
ram_share_principals = optional(list(string), [])
}))
{} no
name Name of the IPAM configuration string null no
regions List of regions the IPAM will operate in list(string) null no
tags Map of tags to apply to all resources map(string) {} no

Outputs

Name Description
arn ARN of the VPC IPAM
ou_pools Map of OU IPAM pools
ou_shares Map of RAM shares for OU IPAM pools
regional_pools Map of regional IPAM pools
regional_shares Map of RAM shares for regional IPAM pools
root_pools Map of root IPAM pools
root_shares Map of RAM shares for root IPAM pools