subnets

drewmullen/subnets/cidr

Terraform Module HCL CIDR

A Terraform module for calculating subnet IP address prefixes

Install
module "subnets" {
source = "drewmullen/subnets/cidr"
version = "1.0.2"
}
plain text: /constructs/tfmod-drewmullen-subnets-cidr/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform CIDR Subnets Module This is a module is a modified version of terraform-cidr-subnets to be used in a few modules I'm working on. There is 1 major modification to the origin and 1 added feature. Documentation is sparse for now but will be improved at a later date. All other features of the original module should still work except explicitly passing new_bits which is now netmask. Netmask instead of bits In many situations, users prefer to use netmask instead of bits. This is quite a simple change from the original post because new_bits = netmask - base_cidr_block cidr. You can generate networks using similar syntax: ``hcl base_cidr_block = "10.0.0.0/16" networks = [ { name = "foo" netmask = 24 }, { name = "bar" netmask = 24 }, { name = "beep" netmask = 24 }, { name = "boop" netmask

Inputs (3)
NameTypeDescriptionDefault
base_cidr_blockstringA network address prefix in CIDR notation that all of the requested subnetwork p required
networkslist(object({ name = sA list of objects describing requested subnetwork prefixes. netmask is the reque required
separatorstringUsed to provide an output of grouped subnets based on a split()[0]."/"
Outputs (4)
network_cidr_blocks — A map from network names to allocated address prefixes in CIDR notation.
networks — A list of objects corresponding to each of the objects in the input variable 'networks', each extend
base_cidr_block — Echoes back the base_cidr_block input variable value, for convenience if passing the result of this
grouped_by_separator
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.2
Cloud CIDR
★ Stars8
Forks3
Total downloads1.6M
Inputs3
Outputs4
LicenseMPL-2.0
Namespacedrewmullen
Updated