diff --git a/modules/device/networks.tf b/modules/device/networks.tf index d7fe2ef..db28d70 100644 --- a/modules/device/networks.tf +++ b/modules/device/networks.tf @@ -11,8 +11,9 @@ resource "netbox_prefix" "local_v4" { resource "netbox_prefix" "networks_v4" { for_each = netbox_vlan.networks - vrf_id = netbox_vrf.local.id - prefix = cidrsubnet(var.client_prefix_v4, 8, each.value.vid) + vrf_id = netbox_vrf.local.id + vlan_id = each.value.id + prefix = cidrsubnet(var.client_prefix_v4, 8, each.value.vid) status = "active" description = "'${each.value.name}' network for ${var.name}" @@ -21,8 +22,9 @@ resource "netbox_prefix" "networks_v4" { resource "netbox_prefix" "networks_v6" { for_each = netbox_vlan.networks - vrf_id = netbox_vrf.local.id - prefix = cidrsubnet(netbox_available_prefix.site_v6.prefix, 8, each.value.vid) + vrf_id = netbox_vrf.local.id + vlan_id = each.value.id + prefix = cidrsubnet(netbox_available_prefix.site_v6.prefix, 8, each.value.vid) status = "active" description = "'${each.value.name}' network for ${var.name}"