Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ resource "openstack_networking_subnet_v2" "subnets" {
dns_publish_fixed_ip = lookup(each.value.subnet, "dns_publish_fixed_ip", false)
service_types = lookup(each.value.subnet, "service_types", [])
subnetpool_id = lookup(each.value.subnet, "subnetpool_id", null)
prefix_length = lookup(each.value.subnet, "prefix_length", null)
no_gateway = lookup(each.value.subnet, "no_gateway", null)
tags = lookup(each.value.subnet, "tags", [])

Expand Down
11 changes: 7 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ variable "networks" {
dns_publish_fixed_ip = optional(bool, false)
service_types = optional(list(string), [])
subnetpool_id = optional(string)
prefix_length = optional(number)
no_gateway = optional(bool)
tags = optional(list(string), [])

Expand Down Expand Up @@ -374,30 +375,32 @@ output "role_assignments" {
# value = {for v in flatten([for rbac in var.network_rbac: [for project in rbac.projects: {rbac=rbac, project=project}]]): "${v.rbac.network}:${v.project}" => v}
# }

output "subnet" {
output "subnets" {
value = {
for k, v in openstack_networking_subnet_v2.subnets :
k => {
id = v.id
gateway_ip = v.gateway_ip
cidr = v.cidr
}
}
}

output "network" {
output "networks" {
value = {
for k, v in openstack_networking_network_v2.networks :
k => {
id = v.id
segments = v.segments
}
}
}

output "router" {
output "routers" {
value = {
for k, v in openstack_networking_router_v2.routers :
k => {
id = v.id
}
}
}
}