Skip to content

Commit

Permalink
Add StatusCake for the test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
vacabor committed Jul 8, 2024
1 parent a639325 commit 2f60b16
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions terraform/application/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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" {
Expand Down
4 changes: 3 additions & 1 deletion terraform/application/config/test.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
16 changes: 7 additions & 9 deletions terraform/application/statuscake.tf
Original file line number Diff line number Diff line change
@@ -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
}
8 changes: 4 additions & 4 deletions terraform/application/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 2f60b16

Please sign in to comment.