Skip to content

Commit 0bbdb3e

Browse files
committed
fix identity block
1 parent 6bdd32c commit 0bbdb3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ resource "azurerm_mysql_flexible_server" "main" {
7171
standby_availability_zone = lookup(high_availability.value, "standby_availability_zone", 1)
7272
}
7373
}
74-
identity {
75-
type = var.identity_type
74+
dynamic "identity" {
75+
for_each = toset(var.identity_type != null ? [var.identity_type] : [])
76+
content {
77+
type = var.identity_type
7678
identity_ids = var.identity_type == "UserAssigned" ? var.user_assigned_identity_ids : []
79+
}
80+
7781
}
7882

7983
version = var.mysql_version

0 commit comments

Comments
 (0)