subnets

hashicorp/subnets/cidr

Terraform Module HCL CIDR

A Terraform module for calculating subnet IP address prefixes

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

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

Inputs (2)
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. new_bits is the numb required
Outputs (3)
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
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.0
Cloud CIDR
★ Stars80
Forks40
Total downloads12.7M
Inputs2
Outputs3
LicenseMPL-2.0
Namespacehashicorp
Updated