Skip to content

Repository files navigation

terraform-provider-nxip-ipam

Terraform provider for nxip: IPAM (IP Address Management) built API-first for infrastructure-as-code. Manages dynamic, conflict-free CIDR subnets across multi-cloud and on-prem environments.

Note on the name: this repository is terraform-provider-nxip-ipam, but the provider publishes to the Registry as uk-sw/nxip, which is the address every release from 0.3.1 through 0.6.0 actually resolves against. A uk-sw/nxip-ipam Registry entry exists but has no published versions, so pointing source at it fails terraform init. Use uk-sw/nxip.

Usage

terraform {
  required_providers {
    nxip = {
      source  = "uk-sw/nxip"
      version = "~> 0.6" # optional, but recommended - see the Registry page for the latest 0.6.x
    }
  }
}

provider "nxip" {
  api_key = var.nxip_api_key # or NXIP_API_KEY env var
}

resource "nxip_pool" "production_us_east" {
  name        = "prod-us-east-1"
  cidr        = "10.0.0.0/16"
  family      = "IPV4"
  environment = "production"
  region      = "us-east-1"
}

resource "nxip_subnet" "web_subnet" {
  environment   = "production"
  region        = "us-east-1"
  family        = "IPV4"
  prefix_length = 24
  name          = "web-tier"

  depends_on = [nxip_pool.production_us_east]
}

resource "nxip_address" "lb_vip" {
  subnet_id = nxip_subnet.web_subnet.id
  address   = "10.0.0.10"
  status    = "RESERVED"
  hostname  = "lb-01"
}

Resources

  • nxip_pool: registers a top-level IP pool, the parent CIDR block that nxip_subnet resources carve non-overlapping subnets from. Scoped to exactly one address family per environment/region.
  • nxip_subnet: a dynamic, non-overlapping CIDR subnet. Auto-resolves onto a matching pool by environment/region/family, or nests directly under an existing subnet via parent_subnet_id.
  • nxip_address: registers or reserves a specific IP address within an already-allocated nxip_subnet. Manual only, by design; no auto-pick.

All three resources support terraform import (nxip_address via a composite <subnet_id>/<address_id> identifier, since its own ID alone isn't enough to fetch it).

Local development

go build ./...
go vet ./...
go test ./...                    # unit tests only
TF_ACC=1 NXIP_URL=http://localhost:3000 NXIP_API_KEY=<a-real-key> go test ./... -v  # acceptance tests, needs a live nxip API

About

Terraform provider repository for the NXIP SaaS API which is a cloud hosted IPAM tool. Cloud agnostic and flexible, supporting IPV4 and IPV6.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages