subnets
drewmullen/subnets/cidr
A Terraform module for calculating subnet IP address prefixes
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
| Name | Type | Description | Default |
|---|---|---|---|
| base_cidr_block | string | A network address prefix in CIDR notation that all of the requested subnetwork p | required |
| networks | list(object({ name = s | A list of objects describing requested subnetwork prefixes. netmask is the reque | required |
| separator | string | Used to provide an output of grouped subnets based on a split()[0]. | "/" |
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 extendbase_cidr_block — Echoes back the base_cidr_block input variable value, for convenience if passing the result of this grouped_by_separator