forked from hashicorp/terraform-cidr-subnets
-
Notifications
You must be signed in to change notification settings - Fork 3
/
outputs.tf
18 lines (15 loc) · 874 Bytes
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
output "network_cidr_blocks" {
value = tomap(local.addrs_by_name)
description = "A map from network names to allocated address prefixes in CIDR notation."
}
output "networks" {
value = tolist(local.network_objs)
description = "A list of objects corresponding to each of the objects in the input variable 'networks', each extended with a new attribute 'cidr_block' giving the network's allocated address prefix."
}
output "base_cidr_block" {
value = var.base_cidr_block
description = "Echoes back the base_cidr_block input variable value, for convenience if passing the result of this module elsewhere as an object."
}
output "grouped_by_separator" {
value = try({ for _, type in local.name_prefixes: type => { for name, cidr in local.addrs_by_name: split(var.separator, name)[1] => cidr if split(var.separator, name)[0] == type}}, null)
}