Skip to content

Commit

Permalink
wireless ssids identity psks group name mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Parafiniuk committed Dec 23, 2024
1 parent 0b15b78 commit 7566f56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion meraki_networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ locals {
for group_policy in try(network.group_policies, []) : {
network_id = meraki_network.network["${organization.name}/${network.name}"].id
data = try(group_policy, null)
key = "${organization.name}/${network.name}/${group_policy.name}"
} if try(network.group_policies, null) != null
] if try(organization.networks, null) != null
] if try(domain.organizations, null) != null
Expand All @@ -15,7 +16,7 @@ locals {
}

resource "meraki_network_group_policy" "net_group_policies" {
for_each = { for i, v in local.networks_group_policies : i => v }
for_each = { for v in local.networks_group_policies : v.key => v }
network_id = each.value.network_id

name = try(each.value.data.name, local.defaults.meraki.networks.group_policies.name, null)
Expand Down
3 changes: 2 additions & 1 deletion meraki_wireless.tf
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ locals {
network_id = meraki_network.network["${organization.name}/${network.name}"].id
number = meraki_wireless_ssid.net_wireless_ssids["${organization.name}/${network.name}/ssids/${wireless_ssid.name}"].number
data = try(identity_psk, null)
group_policy_id = meraki_network_group_policy.net_group_policies["${organization.name}/${network.name}/${identity_psk.group_policy_name}"].id
} if try(wireless_ssid.identity_psks, null) != null
] if try(network.wireless_ssids, null) != null
] if try(organization.networks, null) != null
Expand All @@ -410,10 +411,10 @@ resource "meraki_wireless_ssid_identity_psk" "net_wireless_ssids_identity_psks"
for_each = { for i, v in local.networks_wireless_ssids_identity_psks : i => v }
network_id = each.value.network_id
number = each.value.number
group_policy_id = each.value.group_policy_id

name = try(each.value.data.name, local.defaults.meraki.networks.networks_wireless_ssids_identity_psks.name, null)
passphrase = try(each.value.data.passphrase, local.defaults.meraki.networks.networks_wireless_ssids_identity_psks.passphrase, null)
group_policy_id = try(each.value.data.group_policy_id, local.defaults.meraki.networks.networks_wireless_ssids_identity_psks.group_policy_id, null)
expires_at = try(each.value.data.expires_at, local.defaults.meraki.networks.networks_wireless_ssids_identity_psks.expires_at, null)
depends_on = [
meraki_wireless_ssid.net_wireless_ssids
Expand Down

0 comments on commit 7566f56

Please sign in to comment.