Skip to content

mxk/terraform-null-cidrsum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform cidrsum module

This module aggregates/summarizes a list of IPv4 CIDR blocks using the most compact equivalent representation. The implementation matches the behavior of netaddr.cidr_merge and netipx.IPSetBuilder.

Example

module "cidrsum" {
  source  = "mxk/cidrsum/null"
  version = "~> 1.0"
  cidrs   = ["0.0.0.0/32", "0.0.0.1/32", "0.0.0.2/31"]
}

output "match" {
  value = module.cidrsum.cidrs == tolist(["0.0.0.0/30"])
}