From 6e92b7f93b883fd585879f9be849a5fad28ba0d6 Mon Sep 17 00:00:00 2001 From: Jared Holgate Date: Thu, 1 Aug 2024 19:13:13 +0100 Subject: [PATCH] env var bug fix --- locals.container.instance.tf | 4 ++-- locals.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/locals.container.instance.tf b/locals.container.instance.tf index 7a83218..a44add1 100644 --- a/locals.container.instance.tf +++ b/locals.container.instance.tf @@ -58,6 +58,6 @@ locals { } locals { - container_instance_environment_variables_map = { for env in local.container_instance_environment_variables : env.name => env.value } - container_instance_sensitive_environment_variables_map = { for env in local.container_instance_sensitive_environment_variables : env.name => env.value } + container_instance_environment_variables_map = { for env in local.container_instance_environment_variables : env.name => env.value if env.value != null && env.value != "" } + container_instance_sensitive_environment_variables_map = { for env in local.container_instance_sensitive_environment_variables : env.name => env.value if env.value != null && env.value != "" } } diff --git a/locals.tf b/locals.tf index f33cf43..7e66a90 100644 --- a/locals.tf +++ b/locals.tf @@ -25,7 +25,7 @@ locals { log_analytics_workspace_name = var.log_analytics_workspace_name != null ? var.log_analytics_workspace_name : "laws-${var.postfix}" user_assigned_managed_identity_id = var.user_assigned_managed_identity_id != null ? var.user_assigned_managed_identity_id : module.user_assigned_managed_identity[0].resource_id user_assigned_managed_identity_name = var.user_assigned_managed_identity_name != null ? var.user_assigned_managed_identity_name : "uami-${var.postfix}" - version_control_system_agent_name_prefix = var.version_control_system_agent_name_prefix != null ? var.version_control_system_agent_name_prefix : var.version_control_system_type == local.version_control_system_azure_devops ? "agent-${var.postfix}" : "runner-${var.postfix}" + version_control_system_agent_name_prefix = var.version_control_system_agent_name_prefix != null ? var.version_control_system_agent_name_prefix : (var.version_control_system_type == local.version_control_system_azure_devops ? "agent-${var.postfix}" : "runner-${var.postfix}") virtual_network_name = var.virtual_network_name != null ? var.virtual_network_name : "vnet-${var.postfix}" public_ip_name = var.public_ip_name != null ? var.public_ip_name : "pip-${var.postfix}" nat_gateway_name = var.nat_gateway_name != null ? var.nat_gateway_name : "natgw-${var.postfix}"