FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit e9c359bd authored by Dr Rich Wareham's avatar Dr Rich Wareham
Browse files

Merge branch 'expose_monitoring_path' into 'master'

Expose the monitoring path in the Cloud Run module, otherwise we can't set it up.

Closes #10

See merge request !11
parents a177e995 45212475
No related branches found
No related tags found
1 merge request!11Expose the monitoring path in the Cloud Run module, otherwise we can't set it up.
Pipeline #54146 passed
......@@ -25,3 +25,11 @@ setting this value you *must* have verified ownership of the domain with Google.
[Instructions on how to do
this](https://guidebook.devops.uis.cam.ac.uk/en/latest/notes/google-domain-verification/)
can be found in the DevOps division guidebook.
## Monitoring and Alerting
If the variable [alerting_email_address](variables.tf) is set, the module adds
basic uptime alerting via email for failing http polling. See [variables.tf](variables.tf)
for how to configure alerting and monitoring.
Note that monitoring and alerting must be in a Stackdriver monitoring workspace
and this must be configured manually, at the time of writing this.
......@@ -145,8 +145,9 @@ module "uptime_monitoring" {
source = "./modules/monitoring"
project = var.project
email_address = var.alerting_email_address
monitored_domain = var.dns_name
uptime_timeout = var.alerting_uptime_timeout
uptime_period = var.alerting_uptime_period
monitored_domain = var.dns_name
polling_path = var.monitoring_path
enabled = var.alerting_enabled
}
......@@ -3,9 +3,6 @@
This provides basic uptime alerting via email for failing http polling. See
[variables.tf](variables.tf) for how to configure this module.
Note that the project must be in a Stackdriver monitoring workspace and this
must be configured manually. At the time of writing there is no terraform
support for this. This module will error when applying if this is not so.
......@@ -8,6 +8,12 @@ locals {
count = var.email_address == "" ? 0 : 1
}
resource "google_project_service" "project" {
count = local.count
project = var.project
service = "monitoring.googleapis.com"
}
resource "google_monitoring_uptime_check_config" "https" {
count = local.count
display_name = "https-uptime-check"
......
......@@ -116,3 +116,9 @@ variable "alerting_enabled" {
default = true
description = "Whether alerting policy is enabled"
}
variable "monitoring_path" {
type = string
default = "/"
description = "path component of url to be monitored"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment