-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add our uptimerobot to terraform so it's managed in code and we can easily extend it. This currently only adds our to be monitored sites and leaves the status page as is now. Deleting resources on uptimerobot will cause terraform unable to run see: louy/terraform-provider-uptimerobot#82
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$ANSIBLE_VAULT;1.1;AES256 | ||
62633262613331616434383361643166396632326534376238363661343162383563633738666165 | ||
3265376465363330373030636337643838663232346331660a356536353363363837323466363066 | ||
65363737363465643633323536393261636438383336343334656439333136383934376538653466 | ||
3965373639366131330a633962366637396332363237363364383238663133323664616132303365 | ||
62653761353366623364363365633937343339386562323133353030316635376265356166343965 | ||
64333931383836306563373138383262313335663530623863666565656136653162333437333536 | ||
34346632313438386362643433373936346266353562333562303562303432316330663261303636 | ||
32363735346366323038346336386364313634356131633463373837366261623534626361636563 | ||
36656164633363396231346135643765663062656230333838343538643361383632373533306236 | ||
3261343064333737346166316562616637353330373736633634 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
data "external" "vault_uptimerobot" { | ||
program = ["${path.module}/../misc/get_key.py", "group_vars/all/vault_uptimerobot.yml", | ||
"vault_uptimerobot_api_key", | ||
"vault_uptimerobot_alert_contact", | ||
"--format", "json"] | ||
} | ||
|
||
provider "uptimerobot" { | ||
api_key = data.external.vault_uptimerobot.result.vault_uptimerobot_api_key | ||
} | ||
|
||
data "uptimerobot_account" "account" {} | ||
|
||
data "uptimerobot_alert_contact" "default_alert_contact" { | ||
friendly_name = data.external.vault_uptimerobot.result.vault_uptimerobot_alert_contact | ||
} | ||
|
||
locals { | ||
# This creates to be monitored websites. | ||
# Every line consists of "key" = "value": | ||
# - key equals the friendly name | ||
# - value equals the website url | ||
archlinux_org_monitor = { | ||
"Wiki" = "https://wiki.archlinux.org" | ||
"Website" = "https://archlinux.org" | ||
"Security Tracker" = "https://security.archlinux.org" | ||
"Gitlab" = "https://gitlab.archlinux.org" | ||
"Forum" = "https://bbs.archlinux.org" | ||
"Bugtracker" = "https://bugs.archlinux.org" | ||
"AUR" = "https://aur.archlinux.org" | ||
} | ||
} | ||
|
||
resource "uptimerobot_monitor" "uptimerobot_monitor_archlinux" { | ||
for_each = local.archlinux_org_monitor | ||
|
||
friendly_name = each.key | ||
type = "http" | ||
url = each.value | ||
interval = 300 | ||
|
||
alert_contact { | ||
id = data.uptimerobot_alert_contact.default_alert_contact.id | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters