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 cf8807b commit 7cb3746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloud_Azure/terraform/module/roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ resource "azurerm_role_assignment" "kentik_role_contributor" {

# Provide service principal Reader role to each Resource Group
resource "azurerm_role_assignment" "kentik_role_reader" {
count = length(var.resource_group_names)
for_each = toset(var.resource_group_names)

scope = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group_names[count.index]}"
scope = "/subscriptions/${var.subscription_id}/resourceGroups/${each.value}"
role_definition_name = "Reader"
principal_id = local.kentik_nsg_flow_exporter_id
}

0 comments on commit 7cb3746

Please sign in to comment.