Skip to content

blackbird-cloud/terraform-aws-ipam

Repository files navigation

Terraform Aws Ipam Module

Terraform module to manage IPAM in AWS

blackbird-logo

Example

locals {
  networking_account_id = "123456789012"
  staging_account_id    = "123456789013"
  production_account_id = "123456789014"
}

module "ipam" {
  # source  = "github.com/blackbird-cloud/terraform-aws-ipam"
  source = "../"

  region = "eu-central-1"

  parent_pool = {
    address_family = "ipv4"
    cidr_block     = "10.0.0.0/8"
  }

  pools = {
    shared = {
      address_family = "ipv4"
      cidr_block     = "10.0.0.0/16"
      description    = "shared pool"
      resource_share = local.networking_account_id
    }
    staging = {
      address_family = "ipv4"
      cidr_block     = "10.1.0.0/16"
      description    = "Staging workload pool"
      resource_share = local.staging_account_id
    }
    production = {
      address_family = "ipv4"
      cidr_block     = "10.2.0.0/16"
      description    = "Production workload pool"
      resource_share = local.production_account_id
    }
  }
}

Requirements

Name Version
terraform >= 1.2
aws ~> 5

Providers

Name Version
aws ~> 5

Resources

Name Type
aws_ram_principal_association.default resource
aws_ram_resource_association.default resource
aws_ram_resource_share.default resource
aws_vpc_ipam.main resource
aws_vpc_ipam_pool.child resource
aws_vpc_ipam_pool.parent resource
aws_vpc_ipam_pool_cidr.child resource
aws_vpc_ipam_pool_cidr.parent resource

Inputs

Name Description Type Default Required
cascade (Optional) Enables you to quickly delete an IPAM, private scopes, pools in private scopes, and any allocations in the pools in private scopes. bool null no
description (Optional) A description for the IPAM. string "My IPAM" no
parent_pool The parent pool to create in the IPAM.
object({
address_family = string
cidr_block = string
})
n/a yes
pools The pools to create in the IPAM.
map(object({
address_family = string
description = optional(string)
auto_import = optional(bool)
cidr_block = string
resource_share = optional(string)
}))
n/a yes
region AWS Region used for picking up the ARNs for the securityhub standards subscriptions. string n/a yes
tags (Optional) A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. map(string) {} no

Outputs

Name Description
parent_pool The parent pool created by the module.
pools The sub pools including cidr blocks created by the module.

About

We are Blackbird Cloud, Amsterdam based cloud consultancy, and cloud management service provider. We help companies build secure, cost efficient, and scale-able solutions.

Checkout our other 👉 terraform modules

Copyright

Copyright © 2017-2024 Blackbird Cloud