diff --git a/terraform/application/application.tf b/terraform/application/application.tf index d4afd87ec6..34a7229e5a 100644 --- a/terraform/application/application.tf +++ b/terraform/application/application.tf @@ -17,9 +17,14 @@ module "application_configuration" { PGSSLMODE = local.postgres_ssl_mode CANONICAL_HOSTNAME = local.canonical_hostname }) - secret_variables = { - DATABASE_URL = module.postgres.url - } + secret_variables = merge( + { + DATABASE_URL = module.postgres.url + }, + var.enable_monitoring ? { + HEARTBEAT_CHECK_URL = module.statuscake[0].heartbeat_check_urls[local.heartbeat_check_name] + } : {} + ) } module "web_application" { diff --git a/terraform/application/config/review_Terrafile b/terraform/application/config/review_Terrafile index 65af53b11d..b4c222c13d 100644 --- a/terraform/application/config/review_Terrafile +++ b/terraform/application/config/review_Terrafile @@ -1,3 +1,3 @@ aks: source: "https://github.com/DFE-Digital/terraform-modules" - version: "main" + version: "testing" diff --git a/terraform/application/statuscake.tf b/terraform/application/statuscake.tf index be1b3f03ef..5b56946d88 100644 --- a/terraform/application/statuscake.tf +++ b/terraform/application/statuscake.tf @@ -7,4 +7,6 @@ module "statuscake" { ssl_urls = compact([var.external_url]) contact_groups = var.statuscake_contact_groups + + heartbeat_names = [local.heartbeat_check_name] } diff --git a/terraform/application/variables.tf b/terraform/application/variables.tf index 4453323375..47b1f3cc71 100644 --- a/terraform/application/variables.tf +++ b/terraform/application/variables.tf @@ -89,4 +89,5 @@ locals { canonical_hostname = var.canonical_hostname != null ? var.canonical_hostname : "${var.service_name}-${var.environment}-web.test.teacherservices.cloud" app_env_values_from_yml = yamldecode(file("${path.module}/config/${var.config}_app_env.yml")) app_env_values = merge(local.app_env_values_from_yml) + heartbeat_check_name = "heartbeat-check" }