Azure – how to variablize the resource attribute as input value in terraform
I am trying to use below code data "azurerm_resource_group" "rg_tst_na" { name = "test1" } data "azurerm_resource_group" "rg_dev_na" { name = "test2" } resource "azurerm_role_assignment" "test_role_assign" { for_each = var.test_role_assignment principal_id = azurerm_user_assigned_identity.test_setup["${each.key}_${each.value}"].principal_id # this is created as separate resource…