Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add statuscake monitoring #244

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion terraform/aks/config/production.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,12 @@
"start_minute": 0
},
"postgres_flexible_server_sku": "GP_Standard_D2ds_v4",
"postgres_enable_high_availability": true
"postgres_enable_high_availability": true,
"statuscake_alerts": {
"alert": {
"website_url": [ "https://get-a-teacher-relocation-payment.education.gov.uk/healthcheck/all" ],
"ssl_url": [ "https://get-a-teacher-relocation-payment.education.gov.uk" ],
"contact_group": [282783]
}
}
}
8 changes: 7 additions & 1 deletion terraform/aks/config/qa.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"gov_uk_host_names": [
"qa.get-a-teacher-relocation-payment.education.gov.uk"
],
"azure_enable_backup_storage": false
"azure_enable_backup_storage": false,
"statuscake_alerts": {
"alert": {
"website_url": [ "https://qa.get-a-teacher-relocation-payment.education.gov.uk/healthcheck/all" ],
"contact_group": [282783]
}
}
}
8 changes: 7 additions & 1 deletion terraform/aks/config/staging.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"gov_uk_host_names": [
"staging.get-a-teacher-relocation-payment.education.gov.uk"
],
"azure_enable_backup_storage": false
"azure_enable_backup_storage": false,
"statuscake_alerts": {
"alert": {
"website_url": [ "https://staging.get-a-teacher-relocation-payment.education.gov.uk/healthcheck/all" ],
"contact_group": [282783]
}
}
}
9 changes: 9 additions & 0 deletions terraform/aks/monitoring.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module "statuscake" {
for_each = var.statuscake_alerts

source = "./vendor/modules/aks/monitoring/statuscake"

uptime_urls = each.value.website_url
ssl_urls = try(each.value.ssl_url, [])
contact_groups = each.value.contact_group
}
8 changes: 8 additions & 0 deletions terraform/aks/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ terraform {
source = "hashicorp/kubernetes"
version = "2.20.0"
}
statuscake = {
source = "StatusCakeDev/statuscake"
version = "2.1.0"
}
}
backend "azurerm" {
container_name = "terraform-state"
Expand All @@ -31,3 +35,7 @@ provider "kubernetes" {
client_key = module.cluster_data.kubernetes_client_key
cluster_ca_certificate = module.cluster_data.kubernetes_cluster_ca_certificate
}

provider "statuscake" {
api_token = local.infra_secrets.STATUSCAKE_PASSWORD
}
4 changes: 4 additions & 0 deletions terraform/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ variable "gov_uk_host_names" {
type = list(any)
}
variable "azure_enable_backup_storage" { default = true }
variable "statuscake_alerts" {
type = map(any)
default = {}
}

locals {
service_name = "teacher-relocation-payment"
Expand Down