Skip to content

Commit f7001f3

Browse files
authored
fix: updated resource to count
1 parent 8c1a540 commit f7001f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ resource "azurerm_subnet" "this" {
2121
}
2222

2323
resource "azurerm_subnet_network_security_group_association" "this" {
24-
for_each = var.nsg_id
24+
count = var.nsg_association_enabled ? 1 : 0
2525

2626
subnet_id = var.export_subnet_id == null ? azurerm_subnet.this[0].id : var.export_subnet_id
27-
network_security_group_id = each.value
27+
network_security_group_id = each.nsg_id
2828
}

0 commit comments

Comments
 (0)