Skip to content

Commit

Permalink
Add StatusCake Monitoring
Browse files Browse the repository at this point in the history
Enable for production
  • Loading branch information
divesh987 committed Aug 30, 2023
1 parent 44940b7 commit 44f823a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion terraform/aks/config/production_aks.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"infra_key_vault_name": "s189p01-gitapi-pd-inf-kv",
"cluster": "production",
"namespace": "git-production",
"enable_monitoring": false
"enable_monitoring": false,
"enable_statuscake_alerts": true
}
8 changes: 8 additions & 0 deletions terraform/aks/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ terraform {
source = "hashicorp/kubernetes"
version = "2.20.0"
}
statuscake = {
source = "StatusCakeDev/statuscake"
version = "2.1.0"
}
}
}

Expand All @@ -33,3 +37,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 = module.infrastructure_secrets.map.STATUSCAKE-API-TOKEN
}
8 changes: 8 additions & 0 deletions terraform/aks/secrets.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "infrastructure_secrets" {
source = "./vendor/modules/aks//aks/secrets"

azure_resource_prefix = var.azure_resource_prefix
service_short = var.service_short
config_short = var.config_short
key_vault_short = "inf"
}
9 changes: 9 additions & 0 deletions terraform/aks/statuscake.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module "statuscake" {
count = var.enable_statuscake_alerts ? 1 : 0

source = "git::https://github.com/DFE-Digital/terraform-modules.git//monitoring/statuscake?ref=stable"

uptime_urls = [module.api_application.probe_url]

contact_groups = [185037]
}
2 changes: 2 additions & 0 deletions terraform/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ variable "cluster" {}

variable "enable_monitoring" { default = true }

variable "enable_statuscake_alerts" { default = false }

variable "azure_resource_prefix" {}

variable "config_short" {}
Expand Down

0 comments on commit 44f823a

Please sign in to comment.