Define alert contacts for uptimerobot monitors

This commit is contained in:
Jake Howard 2022-12-09 19:05:35 +00:00
parent e86ed81102
commit 7a89e7f3bc
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -1,3 +1,8 @@
locals {
uptimerobot_email_contact_id = "3407128"
uptimerobot_phone_contact_id = "0355509"
}
resource "uptimerobot_monitor" "vps_ping" { resource "uptimerobot_monitor" "vps_ping" {
for_each = { for_each = {
casey = linode_instance.casey.ip_address casey = linode_instance.casey.ip_address
@ -9,6 +14,14 @@ resource "uptimerobot_monitor" "vps_ping" {
type = "ping" type = "ping"
url = each.value url = each.value
interval = 600 interval = 600
alert_contact {
id = local.uptimerobot_email_contact_id
}
alert_contact {
id = local.uptimerobot_phone_contact_id
}
} }
resource "uptimerobot_monitor" "website" { resource "uptimerobot_monitor" "website" {
@ -16,6 +29,14 @@ resource "uptimerobot_monitor" "website" {
type = "http" type = "http"
url = "https://theorangeone.net/.health/" url = "https://theorangeone.net/.health/"
interval = 300 interval = 300
alert_contact {
id = local.uptimerobot_email_contact_id
}
alert_contact {
id = local.uptimerobot_phone_contact_id
}
} }
resource "uptimerobot_monitor" "grafana" { resource "uptimerobot_monitor" "grafana" {
@ -23,6 +44,14 @@ resource "uptimerobot_monitor" "grafana" {
type = "http" type = "http"
url = "https://grafana.jakehoward.tech/api/health" url = "https://grafana.jakehoward.tech/api/health"
interval = 300 interval = 300
alert_contact {
id = local.uptimerobot_email_contact_id
}
alert_contact {
id = local.uptimerobot_phone_contact_id
}
} }
resource "uptimerobot_monitor" "whoami" { resource "uptimerobot_monitor" "whoami" {
@ -30,6 +59,14 @@ resource "uptimerobot_monitor" "whoami" {
type = "http" type = "http"
url = "https://whoami.theorangeone.net" url = "https://whoami.theorangeone.net"
interval = 300 interval = 300
alert_contact {
id = local.uptimerobot_email_contact_id
}
alert_contact {
id = local.uptimerobot_phone_contact_id
}
} }
resource "uptimerobot_status_page" "main" { resource "uptimerobot_status_page" "main" {