Skip to content

Commit

Permalink
more count to for_each conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jksprattler committed Nov 27, 2024
1 parent 7cb3746 commit 20b66e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cloud_Azure/terraform/module/storage_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ locals {
# Creates one storage account per resource group to store flow logs
# StorageAccounts are mapped 1:1 to resource_group_names and this fact is used to get storage account id for given resource group name
resource "azurerm_storage_account" "logs_storage_account" {
for_each = { for s, rg in var.resource_group_names : rg => s }
#for_each = { for s, rg in var.resource_group_names : rg => s }
for_each = toset(var.resource_group_names)

# use either custom name if one is provided, or generated one
name = length(var.storage_account_names) == length(var.resource_group_names) ? var.storage_account_names[each.value] : local.generated_storage_account_names[each.value]
Expand Down

0 comments on commit 20b66e6

Please sign in to comment.