From 7a89e7f3bcee35a281ae02297c93901796940ffc Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 9 Dec 2022 19:05:35 +0000 Subject: [PATCH] Define alert contacts for uptimerobot monitors --- terraform/uptimerobot.tf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/terraform/uptimerobot.tf b/terraform/uptimerobot.tf index 7c2457c..f08bef4 100644 --- a/terraform/uptimerobot.tf +++ b/terraform/uptimerobot.tf @@ -1,3 +1,8 @@ +locals { + uptimerobot_email_contact_id = "3407128" + uptimerobot_phone_contact_id = "0355509" +} + resource "uptimerobot_monitor" "vps_ping" { for_each = { casey = linode_instance.casey.ip_address @@ -9,6 +14,14 @@ resource "uptimerobot_monitor" "vps_ping" { type = "ping" url = each.value interval = 600 + + alert_contact { + id = local.uptimerobot_email_contact_id + } + + alert_contact { + id = local.uptimerobot_phone_contact_id + } } resource "uptimerobot_monitor" "website" { @@ -16,6 +29,14 @@ resource "uptimerobot_monitor" "website" { type = "http" url = "https://theorangeone.net/.health/" interval = 300 + + alert_contact { + id = local.uptimerobot_email_contact_id + } + + alert_contact { + id = local.uptimerobot_phone_contact_id + } } resource "uptimerobot_monitor" "grafana" { @@ -23,6 +44,14 @@ resource "uptimerobot_monitor" "grafana" { type = "http" url = "https://grafana.jakehoward.tech/api/health" interval = 300 + + alert_contact { + id = local.uptimerobot_email_contact_id + } + + alert_contact { + id = local.uptimerobot_phone_contact_id + } } resource "uptimerobot_monitor" "whoami" { @@ -30,6 +59,14 @@ resource "uptimerobot_monitor" "whoami" { type = "http" url = "https://whoami.theorangeone.net" interval = 300 + + alert_contact { + id = local.uptimerobot_email_contact_id + } + + alert_contact { + id = local.uptimerobot_phone_contact_id + } } resource "uptimerobot_status_page" "main" {