Skip to content

Commit

Permalink
refactor: Remove commented out code in meraki_networks.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-humphries committed Jul 18, 2024
1 parent 5839b60 commit b256753
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions meraki_networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -459,40 +459,40 @@ resource "meraki_networks_switch_stacks" "net_switch_stacks" {
# switch_stack_id = try(each.value.data.switch_stack_id, null)
}

locals {
networks_switch_stacks_routing_interfaces = flatten([
for domain in try(local.meraki.domains, []) : [
for org in try(domain.organizations, []) : [
for network in try(org.networks, []) : [
for switch_stack in try(network.switch_stacks, []) : [
for interface in try(switch_stack.routing_interfaces, []) : {
network_id = meraki_networks.networks["${domain.name}/${org.name}/${network.name}"].id
switch_stack_id = meraki_networks_switch_stacks.net_switch_stacks["${domain.name}/${org.name}/${network.name}/stacks/${switch_stack.name}"].id
interface_key = format("%s/%s/%s/stacks/%s/interfaces/%s", domain.name, org.name, network.name, switch_stack.name, interface.name)
data = interface
}
]
]
]
]
])
}
# locals {
# networks_switch_stacks_routing_interfaces = flatten([
# for domain in try(local.meraki.domains, []) : [
# for org in try(domain.organizations, []) : [
# for network in try(org.networks, []) : [
# for switch_stack in try(network.switch_stacks, []) : [
# for interface in try(switch_stack.routing_interfaces, []) : {
# network_id = meraki_networks.networks["${domain.name}/${org.name}/${network.name}"].id
# switch_stack_id = meraki_networks_switch_stacks.net_switch_stacks["${domain.name}/${org.name}/${network.name}/stacks/${switch_stack.name}"].id
# interface_key = format("%s/%s/%s/stacks/%s/interfaces/%s", domain.name, org.name, network.name, switch_stack.name, interface.name)
# data = interface
# }
# ]
# ]
# ]
# ]
# ])
# }

resource "meraki_networks_switch_stacks_routing_interfaces" "net_switch_stacks_routing_interfaces" {
for_each = { for i, v in local.networks_switch_stacks_routing_interfaces : i => v }
switch_stack_id = each.value.switch_stack_id
network_id = each.value.network_id
# default_gateway = try(each.value.data.default_gateway, null)
# interface_id = try(each.value.data.interface_id, null)
interface_ip = try(each.value.data.interface_ip, null)
ipv6 = try(each.value.data.ipv6, null)
multicast_routing = try(each.value.data.multicast_routing, null)
name = try(each.value.data.name, null)
ospf_settings = try(each.value.data.ospf_settings, null)
# ospf_v3 = try(each.value.data.ospf_v3, null)
subnet = try(each.value.data.subnet, null)
vlan_id = try(each.value.data.vlan_id, null)
}
# resource "meraki_networks_switch_stacks_routing_interfaces" "net_switch_stacks_routing_interfaces" {
# for_each = { for i, v in local.networks_switch_stacks_routing_interfaces : i => v }
# switch_stack_id = each.value.switch_stack_id
# network_id = each.value.network_id
# # default_gateway = try(each.value.data.default_gateway, null)
# # interface_id = try(each.value.data.interface_id, null)
# interface_ip = try(each.value.data.interface_ip, null)
# ipv6 = try(each.value.data.ipv6, null)
# multicast_routing = try(each.value.data.multicast_routing, null)
# name = try(each.value.data.name, null)
# ospf_settings = try(each.value.data.ospf_settings, null)
# # ospf_v3 = try(each.value.data.ospf_v3, null)
# subnet = try(each.value.data.subnet, null)
# vlan_id = try(each.value.data.vlan_id, null)
# }


# locals {
Expand Down

0 comments on commit b256753

Please sign in to comment.