A Terraform provider that exposes utility functions for CIDR/IP network operations.
Returns true if the containing CIDR prefix fully encompasses the contained CIDR prefix.
provider::utils::cidrcontains("10.0.0.0/8", "10.1.0.0/16") # true
provider::utils::cidrcontains("10.0.0.0/8", "192.168.0.0/16") # false
provider::utils::cidrcontains("10.0.0.0/8", "10.1.2.3/32") # trueReturns true if two CIDR prefixes have any addresses in common.
provider::utils::cidroverlaps("10.0.0.0/8", "10.1.0.0/16") # true
provider::utils::cidroverlaps("10.0.0.0/8", "192.168.0.0/16") # falseReturns true if no pair of CIDR prefixes in the list overlaps with each other.
provider::utils::cidrnoverlap(["10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12"]) # true
provider::utils::cidrnoverlap(["10.0.0.0/8", "10.1.0.0/16", "192.168.0.0/16"]) # falseAll functions:
- Require CIDR notation for all arguments (use
/32or/128for single hosts) - Support both IPv4 and IPv6
- Return an error if address families are mixed
go installTo generate documentation:
make generateTo run tests:
make testacc