Skip to content

Commit

Permalink
refactor: Update Meraki organization network configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-humphries committed Jun 10, 2024
1 parent 64f9057 commit 7474d1e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions meraki_organization.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ data "meraki_organizations" "organizations" {
output "test" {
value = data.meraki_organizations.organizations.item.name
}
locals {
organization_map = { for organization in data.meraki_organizations.organizations.items : organization.name => organization.id }
networks = flatten([
for org in try(local.meraki.domains.organizations, []) : [
for network in try(org.networks, []) : {
key = format("%s/%s", org.name, network.name)
organization_id = local.organization_map[org.name]
name = try(network.name, local.defaults.meraki.organizations.networks.name)
notes = try(network.notes, local.defaults.meraki.organizations.networks.notes)
product_types = try(network.product_types, local.defaults.meraki.organizations.networks.product_types)
tags = try(network.tags, local.defaults.meraki.organizations.networks.tags)
time_zone = try(network.timezone, local.defaults.meraki.organizations.networks.timezone)
}
]
])
}
# locals {
# organization_map = { for organization in data.meraki_organizations.organizations.items : organization.name => organization.id }
# networks = flatten([
# for org in try(local.meraki.domains.organizations, []) : [
# for network in try(org.networks, []) : {
# key = format("%s/%s", org.name, network.name)
# organization_id = local.organization_map[org.name]
# name = try(network.name, local.defaults.meraki.organizations.networks.name)
# notes = try(network.notes, local.defaults.meraki.organizations.networks.notes)
# product_types = try(network.product_types, local.defaults.meraki.organizations.networks.product_types)
# tags = try(network.tags, local.defaults.meraki.organizations.networks.tags)
# time_zone = try(network.timezone, local.defaults.meraki.organizations.networks.timezone)
# }
# ]
# ])
# }
# output "meraki_domains_organizations" {
# description = "Output the value of local.meraki.domains.organizations for debugging"
# value = local.meraki.domains.organizations
Expand Down

0 comments on commit 7474d1e

Please sign in to comment.