Skip to content

Commit

Permalink
Merge pull request #205 from DFE-Digital/2169-monitor-technical-guida…
Browse files Browse the repository at this point in the history
…nce-ssl-cert

[2169] Enable monitoring
  • Loading branch information
saliceti authored Dec 6, 2024
2 parents 36a6d56 + 9a4457d commit 8efdcb4
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ terraform-init: composed-variables set-azure-account
$(if ${DOCKER_IMAGE_TAG}, , $(eval DOCKER_IMAGE_TAG=main))

rm -rf terraform/application/vendor/modules/aks
git clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/application/vendor/modules/aks
git -c advice.detachedHead=false clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/application/vendor/modules/aks

terraform -chdir=terraform/application init -upgrade -reconfigure \
-backend-config=resource_group_name=${RESOURCE_GROUP_NAME} \
Expand Down Expand Up @@ -107,7 +107,7 @@ check-links: build

domains-infra-init: domains composed-variables set-azure-account
rm -rf terraform/domains/infrastructure/vendor/modules/domains
git clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/domains/infrastructure/vendor/modules/domains
git -c advice.detachedHead=false clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/domains/infrastructure/vendor/modules/domains

terraform -chdir=terraform/domains/infrastructure init -reconfigure -upgrade \
-backend-config=resource_group_name=${RESOURCE_GROUP_NAME} \
Expand All @@ -122,7 +122,7 @@ domains-infra-apply: domains composed-variables domains-infra-init

domains-init: domains composed-variables set-azure-account
rm -rf terraform/domains/environment_domains/vendor/modules/domains
git clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/domains/environment_domains/vendor/modules/domains
git -c advice.detachedHead=false clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/domains/environment_domains/vendor/modules/domains

terraform -chdir=terraform/domains/environment_domains init -upgrade -reconfigure \
-backend-config=resource_group_name=${RESOURCE_GROUP_NAME} \
Expand Down
23 changes: 23 additions & 0 deletions terraform/application/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion terraform/application/config/production.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"cluster": "production",
"namespace": "tech-arch-production",
"environment": "production"
"environment": "production",
"external_url": "https://technical-guidance.education.gov.uk/",
"enable_monitoring": true,
"statuscake_contact_groups": [282453]
}
10 changes: 10 additions & 0 deletions terraform/application/statuscake.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module "statuscake" {
count = var.enable_monitoring ? 1 : 0

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

uptime_urls = compact([var.external_url])
ssl_urls = compact([var.external_url])

contact_groups = var.statuscake_contact_groups
}
8 changes: 7 additions & 1 deletion terraform/application/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ terraform {
source = "hashicorp/kubernetes"
version = "2.24.0"
}

statuscake = {
source = "StatusCakeDev/statuscake"
version = "2.2.2"
}
}
backend "azurerm" {
container_name = "terraform-state"
Expand Down Expand Up @@ -37,5 +40,8 @@ provider "kubernetes" {
args = module.cluster_data.kubelogin_args
}
}
}

provider "statuscake" {
api_token = module.infrastructure_secrets.map.STATUSCAKE-API-TOKEN
}

0 comments on commit 8efdcb4

Please sign in to comment.