Skip to content

Commit

Permalink
azure_export for_each
Browse files Browse the repository at this point in the history
  • Loading branch information
jksprattler committed Nov 28, 2024
1 parent 558e8d8 commit 1e10f10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloud_Azure/terraform/module/cloudexport.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ provider "kentik-cloudexport" {

# Creates one Kentik CloudExport for every requested Resource Group
resource "kentik-cloudexport_item" "azure_export" {
for_each = toset(var.resource_group_names)
for_each = { for nsg in local.flat_nsgs : nsg.key => nsg.value }

name = "${var.name}-${each.value}-${var.subscription_id}" # resource group name + subscription id make the name unique
name = "${var.name}-${var.subscription_id}" # resource group name + subscription id make the name unique
type = "CLOUD_EXPORT_TYPE_KENTIK_MANAGED"
enabled = var.enabled
description = var.description
Expand All @@ -25,7 +25,7 @@ resource "kentik-cloudexport_item" "azure_export" {
azure {
subscription_id = var.subscription_id
location = var.location
resource_group = each.value
resource_group = each.value.rg
storage_account = azurerm_storage_account.logs_storage_account[each.key].name # storage accounts are mapped 1:1+:1 to nsg(s) and resource_group_names
security_principal_enabled = true
}
Expand Down

0 comments on commit 1e10f10

Please sign in to comment.