subnets
hashicorp/subnets/cidr
A Terraform module for calculating subnet IP address prefixes
Terraform CIDR Subnets Module This is a simple Terraform module for calculating subnet addresses under a particular CIDR prefix. This module requires Terraform v0.12.10 or later. ``hcl module "subnet_addrs" { source = "hashicorp/subnets/cidr" base_cidr_block = "10.0.0.0/8" networks = [ { name = "foo" new_bits = 8 }, { name = "bar" new_bits = 8 }, { name = "baz" new_bits = 4 }, { name = "beep" new_bits = 8 }, { name = "boop" new_bits = 8 }, ] } ` The module assigns consecutive IP address blocks to each of the requested networks, packing them densely in the address space. The network_cidr_blocks output is then a map from the given name strings to the allocated CIDR prefixes: `hcl { foo = "10.0.0.0/16" bar = "10.1.0.0/16" baz = "10.16.0.0/12" beep = "10.32.0.0/16" boop = "10.33.0.0/16" } ` Th
| 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. new_bits is the numb | required |
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