Skip to content

Commit

Permalink
Merge pull request #65 from clouddrove/fix/identity
Browse files Browse the repository at this point in the history
fix identity block
  • Loading branch information
d4kverma authored Oct 30, 2024
2 parents 77e39e4 + 4018962 commit 5f169f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ resource "azurerm_mysql_flexible_server" "main" {
standby_availability_zone = lookup(high_availability.value, "standby_availability_zone", 1)
}
}
identity {
type = var.identity_type
identity_ids = var.identity_type == "UserAssigned" ? var.user_assigned_identity_ids : []
dynamic "identity" {
for_each = toset(var.identity_type != null ? [var.identity_type] : [])
content {
type = var.identity_type
identity_ids = var.identity_type == "UserAssigned" ? var.user_assigned_identity_ids : []
}

}

version = var.mysql_version
Expand All @@ -97,7 +101,7 @@ resource "azurerm_mysql_flexible_server_active_directory_administrator" "main" {
object_id = var.entra_authentication.object_id
tenant_id = data.azurerm_client_config.current.tenant_id

depends_on = [ azurerm_mysql_flexible_server.main ]
depends_on = [azurerm_mysql_flexible_server.main]
}

##-----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ output "azurerm_private_dns_zone_id" {
}

output "password_result" {
value = var.admin_password == null ? random_password.main[0].result : var.admin_password
value = var.admin_password == null ? random_password.main[0].result : var.admin_password
description = "Password Value"
sensitive = true
sensitive = true
}


Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ variable "eventhub_authorization_rule_id" {
}

variable "custom_tags" {
type = map(string)
type = map(string)
default = {}
}

Expand Down

0 comments on commit 5f169f1

Please sign in to comment.