Skip to content

Commit 37da53f

Browse files
committed
DTOSS-00000: Fix circular depedency on healthcheck
Fix circular dependency involving the health check target_url. The Container App child module derives the health check URL from external_url, so passing target_url into the module is unnecessary.
1 parent 958dba1 commit 37da53f

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

infrastructure/modules/container-apps/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ module "azurerm_application_insights_standard_web_test" {
6363
location = var.region
6464
action_group_id = var.action_group_id
6565
application_insights_id = var.app_insights_id
66-
target_url = var.target_url
66+
target_url = "${local.external_url}healthcheck"
6767
}

infrastructure/modules/container-apps/variables.tf

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,6 @@ variable "enable_alerting" {
159159
type = bool
160160
}
161161

162-
variable "target_url" {
163-
description = "The external url"
164-
type = string
165-
}
166-
167162
variable "alert_window_size" {
168163
type = string
169164
nullable = false
@@ -223,6 +218,7 @@ locals {
223218
env_vars_from_yaml = yamldecode(
224219
file("${path.module}/../../environments/${var.env_config}/variables.yml")
225220
)
221+
external_url = "https://${module.frontdoor_endpoint.custom_domains["${var.environment}-domain"].host_name}/"
226222
common_env = merge(
227223
local.env_vars_from_yaml,
228224
{
@@ -239,9 +235,9 @@ locals {
239235

240236
azure_db_env = {
241237
AZURE_DB_CLIENT_ID = var.deploy_database_as_container ? null : module.db_connect_identity[0].client_id
242-
DATABASE_HOST = var.deploy_database_as_container ? null : module.postgres[0].host
243-
DATABASE_NAME = var.deploy_database_as_container ? null : module.postgres[0].database_names[0]
244-
DATABASE_USER = var.deploy_database_as_container ? null : module.db_connect_identity[0].name
238+
DATABASE_HOST = var.deploy_database_as_container ? null : module.postgres[0].host
239+
DATABASE_NAME = var.deploy_database_as_container ? null : module.postgres[0].database_names[0]
240+
DATABASE_USER = var.deploy_database_as_container ? null : module.db_connect_identity[0].name
245241
}
246242

247243
storage_account_name = "st${var.app_short_name}${var.environment}uks"

infrastructure/terraform/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ module "container-apps" {
7878
use_apex_domain = var.use_apex_domain
7979
infra_key_vault_name = local.infra_key_vault_name
8080
infra_key_vault_rg = local.infra_key_vault_rg
81-
target_url = var.deploy_container_apps ? "${module.container-apps[0].external_url}healthcheck" : null
8281
resource_group_name_infra = local.resource_group_name
8382
container_memory = var.container_memory
8483
min_replicas = var.min_replicas

0 commit comments

Comments
 (0)