Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link agg device mapping #22

Merged
merged 2 commits into from
Dec 10, 2024
Merged
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
9 changes: 6 additions & 3 deletions meraki_switches.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ locals {
for network in try(organization.networks, []) : [
for switch_link_aggregation in try(network.switch_link_aggregations, []) : {
network_id = meraki_network.network["${organization.name}/${network.name}"].id

switch_ports = [for p in switch_link_aggregation.switch_ports : {
serial = meraki_device.device["${organization.name}/${network.name}/devices/${p.device}"].serial
port_id = p.port_id
}]
data = try(switch_link_aggregation, null)
} if try(network.switch_link_aggregations, null) != null
] if try(organization.networks, null) != null
Expand All @@ -189,10 +192,10 @@ resource "meraki_switch_link_aggregation" "net_switch_link_aggregation" {
for_each = { for i, v in local.networks_switch_link_aggregations : i => v }
network_id = each.value.network_id

switch_ports = try(each.value.data.switch_ports, local.defaults.meraki.networks.networks_switch_link_aggregations.switch_ports, null)
switch_ports = each.value.switch_ports
switch_profile_ports = try(each.value.data.switch_profile_ports, local.defaults.meraki.networks.networks_switch_link_aggregations.switch_profile_ports, null)

depends_on = [meraki_network_device_claim.net_device_claim]
depends_on = [meraki_switch_stack.net_switch_stacks]
}


Expand Down
Loading