From 41a721b7e63b3a6fed2c64fc75883e6675c35f89 Mon Sep 17 00:00:00 2001 From: Abdullah Khairi Date: Mon, 28 Sep 2020 14:00:45 +0800 Subject: [PATCH] Ak hotfix ase privatedns record name (#39) * concate asename into private dns record name * Update private dns a record ase name logic --- modules/databases/mssql_server/output.tf | 4 ++-- modules/webapps/ase/private_dns_records.tf | 2 +- mssql_databases.tf | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/databases/mssql_server/output.tf b/modules/databases/mssql_server/output.tf index 3b4566c3ac..11ce778b4a 100644 --- a/modules/databases/mssql_server/output.tf +++ b/modules/databases/mssql_server/output.tf @@ -10,6 +10,6 @@ output identity { value = try(azurerm_mssql_server.mssql.identity, null) } -output azuread_administrator { - value = try(azurerm_mssql_server.mssql.azuread_administrator , null) +output azuread_administrator { + value = try(azurerm_mssql_server.mssql.azuread_administrator, null) } \ No newline at end of file diff --git a/modules/webapps/ase/private_dns_records.tf b/modules/webapps/ase/private_dns_records.tf index d3fdaed3ff..142226af9c 100644 --- a/modules/webapps/ase/private_dns_records.tf +++ b/modules/webapps/ase/private_dns_records.tf @@ -4,7 +4,7 @@ resource "azurerm_private_dns_a_record" "a_records" { ] for_each = try(var.settings.private_dns_records.a_records, {}) - name = format("%s.%s", each.value.name, azurecaf_name.ase.result) + name = each.value.name == "" ? azurecaf_name.ase.result : format("%s.%s", each.value.name, azurecaf_name.ase.result) resource_group_name = lookup(each.value, "remote_tfstate", null) == null ? var.private_dns[each.value.private_dns_key].resource_group_name : data.terraform_remote_state.ase_vnet_dns[each.key].outputs[each.value.remote_tfstate.output_key][each.value.private_dns_key].resource_group_name zone_name = lookup(each.value, "remote_tfstate", null) == null ? var.private_dns[each.value.private_dns_key].name : data.terraform_remote_state.ase_vnet_dns[each.key].outputs[each.value.remote_tfstate.output_key][each.value.private_dns_key].name ttl = each.value.ttl diff --git a/mssql_databases.tf b/mssql_databases.tf index a7e77e1cec..7a47515e8e 100755 --- a/mssql_databases.tf +++ b/mssql_databases.tf @@ -5,8 +5,8 @@ output mssql_databases { } module "mssql_databases" { - source = "./modules/databases/mssql_database" - for_each = local.database.mssql_databases + source = "./modules/databases/mssql_database" + for_each = local.database.mssql_databases global_settings = local.global_settings settings = each.value