From 0bbdb3e4c17855bb742c7bc60a4f8baff1364949 Mon Sep 17 00:00:00 2001 From: Deepak Verma Date: Wed, 30 Oct 2024 13:04:33 +0530 Subject: [PATCH] fix identity block --- main.tf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index f356956..54e37b5 100644 --- a/main.tf +++ b/main.tf @@ -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 + 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