From f1de1eb7dedce67b30bb9a8daec94dde0fdc48bc Mon Sep 17 00:00:00 2001 From: Ken Sun Date: Tue, 21 Jan 2025 08:43:09 -0500 Subject: [PATCH] improve code --- module.tf | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/module.tf b/module.tf index 4e14536..6ac05d7 100644 --- a/module.tf +++ b/module.tf @@ -7,18 +7,9 @@ resource "azurerm_data_factory" "df" { managed_virtual_network_enabled = try(var.data_factory.managed_virtual_network_enabled,true) public_network_enabled = try(var.data_factory.public_network_enabled, false) - dynamic identity { - for_each = var.data_factory.identity.type == "SystemAssigned" ? [1] : [] - content{ - type = var.data_factory.identity.type - } - } - dynamic identity { - for_each = var.data_factory.identity.type == "UserAssigned" ? [1] : [] - content{ + identity { type = var.data_factory.identity.type - identity_ids = [azurerm_user_assigned_identity.ui[0].id] - } + identity_ids = var.data_factory.identity.type == "UserAssigned" ? [azurerm_user_assigned_identity.ui[0].id] :null } tags = var.tags