diff --git a/terraform/application/application.tf b/terraform/application/application.tf index 9818895f82..04e6504b61 100644 --- a/terraform/application/application.tf +++ b/terraform/application/application.tf @@ -13,10 +13,10 @@ module "application_configuration" { config_variables = merge( local.app_env_values, { - ENVIRONMENT_NAME = var.environment - PGSSLMODE = local.postgres_ssl_mode + ENVIRONMENT_NAME = var.environment + PGSSLMODE = local.postgres_ssl_mode CANONICAL_HOSTNAME = local.canonical_hostname - }) + }) secret_variables = { DATABASE_URL = module.postgres.url } @@ -39,7 +39,7 @@ module "web_application" { docker_image = var.docker_image command = var.startup_command - replicas = var.web_replicas + replicas = var.web_replicas } module "worker_application" { diff --git a/terraform/application/config/test.tfvars.json b/terraform/application/config/test.tfvars.json index 31970e11c3..acd79a19af 100644 --- a/terraform/application/config/test.tfvars.json +++ b/terraform/application/config/test.tfvars.json @@ -6,5 +6,7 @@ "canonical_hostname": "claim-additional-payments-for-teaching-test-web.test.teacherservices.cloud", "web_replicas": 2, "startup_command": ["/bin/sh", "-c", "bin/rails server -b 0.0.0.0"], - "worker_command": ["/bin/sh", "-c", "bin/bundle exec bin/delayed_job run -n 1"] + "worker_command": ["/bin/sh", "-c", "bin/bundle exec bin/delayed_job run -n 1"], + "enable_monitoring": true, + "statuscake_contact_groups": [195955, 282453] } diff --git a/terraform/application/statuscake.tf b/terraform/application/statuscake.tf index 840f7a8ad6..be1b3f03ef 100644 --- a/terraform/application/statuscake.tf +++ b/terraform/application/statuscake.tf @@ -1,12 +1,10 @@ -# TODO: Uncomment when needed then follow these steps: https://github.com/DFE-Digital/teacher-services-cloud/blob/main/documentation/onboard-service.md#configure-statuscake-credentials +module "statuscake" { + count = var.enable_monitoring ? 1 : 0 -# module "statuscake" { -# count = var.enable_monitoring ? 1 : 0 + source = "./vendor/modules/aks//monitoring/statuscake" -# source = "./vendor/modules/aks//monitoring/statuscake" + uptime_urls = compact([module.web_application.probe_url, var.external_url]) + ssl_urls = compact([var.external_url]) -# uptime_urls = compact([module.web_application.probe_url, var.external_url]) -# ssl_urls = compact([var.external_url]) - -# contact_groups = var.statuscake_contact_groups -# } + contact_groups = var.statuscake_contact_groups +} diff --git a/terraform/application/variables.tf b/terraform/application/variables.tf index d2e6ae8677..7c132eb37e 100644 --- a/terraform/application/variables.tf +++ b/terraform/application/variables.tf @@ -62,12 +62,12 @@ variable "canonical_hostname" { } variable "web_replicas" { description = "Number of replicas of the web app" - default = 1 + default = 1 } locals { - postgres_ssl_mode = var.enable_postgres_ssl ? "require" : "disable" - canonical_hostname = var.canonical_hostname != null ? var.canonical_hostname : "${var.service_name}-${var.environment}-web.test.teacherservices.cloud" + postgres_ssl_mode = var.enable_postgres_ssl ? "require" : "disable" + 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) + app_env_values = merge(local.app_env_values_from_yml) }