Skip to content

Commit 5f169f1

Browse files
authored
Merge pull request #65 from clouddrove/fix/identity
fix identity block
2 parents 77e39e4 + 4018962 commit 5f169f1

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

main.tf

Lines changed: 8 additions & 4 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
76-
identity_ids = var.identity_type == "UserAssigned" ? var.user_assigned_identity_ids : []
74+
dynamic "identity" {
75+
for_each = toset(var.identity_type != null ? [var.identity_type] : [])
76+
content {
77+
type = var.identity_type
78+
identity_ids = var.identity_type == "UserAssigned" ? var.user_assigned_identity_ids : []
79+
}
80+
7781
}
7882

7983
version = var.mysql_version
@@ -97,7 +101,7 @@ resource "azurerm_mysql_flexible_server_active_directory_administrator" "main" {
97101
object_id = var.entra_authentication.object_id
98102
tenant_id = data.azurerm_client_config.current.tenant_id
99103

100-
depends_on = [ azurerm_mysql_flexible_server.main ]
104+
depends_on = [azurerm_mysql_flexible_server.main]
101105
}
102106

103107
##-----------------------------------------------------------------------------

output.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ output "azurerm_private_dns_zone_id" {
2121
}
2222

2323
output "password_result" {
24-
value = var.admin_password == null ? random_password.main[0].result : var.admin_password
24+
value = var.admin_password == null ? random_password.main[0].result : var.admin_password
2525
description = "Password Value"
26-
sensitive = true
26+
sensitive = true
2727
}
2828

2929

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ variable "eventhub_authorization_rule_id" {
298298
}
299299

300300
variable "custom_tags" {
301-
type = map(string)
301+
type = map(string)
302302
default = {}
303303
}
304304

0 commit comments

Comments
 (0)