mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2024-05-28 17:36:07 +02:00
faba3a3d7c
Now that misc/get_key.py checks if the vault file passed to it exists,
we cannot pass paths only resolvable from the root directory. Instead,
use paths that make sense relative to the current directory and avoid
calling chdir when loading the vault file.
Fixes: 7754214604
("Rewrite get_key.py to use click instead of typer")
47 lines
1.5 KiB
HCL
47 lines
1.5 KiB
HCL
# When deleting a resource outside of terraform, the provider errors out and a
|
|
# resource has to be manually deleted in terraform, see:
|
|
# https://github.com/louy/terraform-provider-uptimerobot/issues/82
|
|
|
|
data "external" "vault_uptimerobot" {
|
|
program = ["${path.module}/../misc/get_key.py", "${path.module}/../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 {
|
|
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"
|
|
"Man" = "https://man.archlinux.org"
|
|
}
|
|
}
|
|
|
|
resource "uptimerobot_monitor" "uptimerobot_monitor_archlinux" {
|
|
for_each = local.archlinux_org_monitor
|
|
|
|
friendly_name = each.key
|
|
type = "http"
|
|
url = each.value
|
|
interval = 60
|
|
|
|
alert_contact {
|
|
id = data.uptimerobot_alert_contact.default_alert_contact.id
|
|
}
|
|
}
|