From 1b02b9c0979c6c5c27104de4062ec97fdcfb83b8 Mon Sep 17 00:00:00 2001 From: Eytan Naim Date: Thu, 9 May 2024 10:40:34 +0300 Subject: [PATCH] Azure mx | Fix address selection --- modules/azurerm/dam-base-instance/main.tf | 2 +- modules/azurerm/mx/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/azurerm/dam-base-instance/main.tf b/modules/azurerm/dam-base-instance/main.tf index 798652a06..e2ca21e2c 100644 --- a/modules/azurerm/dam-base-instance/main.tf +++ b/modules/azurerm/dam-base-instance/main.tf @@ -1,5 +1,5 @@ locals { - public_ip = azurerm_linux_virtual_machine.dsf_base_instance.public_ip_address + public_ip = azurerm_linux_virtual_machine.dsf_base_instance.public_ip_address == "" ? null : azurerm_linux_virtual_machine.dsf_base_instance.public_ip_address private_ip = azurerm_linux_virtual_machine.dsf_base_instance.private_ip_address # root volume details diff --git a/modules/azurerm/mx/main.tf b/modules/azurerm/mx/main.tf index 7ad3a819f..891ece7c0 100644 --- a/modules/azurerm/mx/main.tf +++ b/modules/azurerm/mx/main.tf @@ -1,7 +1,7 @@ locals { dam_model = "MVM150" resource_type = "mx" - mx_address_for_api = module.mx.public_ip != null ? module.mx.public_ip : module.mx.private_ip + mx_address_for_api = coalesce(module.mx.public_ip, module.mx.private_ip) security_groups_config = [ # https://docs.imperva.com/bundle/v14.14-dam-on-microsoft-azure-installation-guide/page/83147.htm { name = ["web", "console", "and", "api"]