Post-Tyranny-Tech-Infrastru.../tofu/dns.tf
Pieter 9a3afa325b feat: Configure status.vrije.cloud and auto-monitor integration
Updates to Uptime Kuma monitoring setup:

DNS Configuration:
- Added DNS A record for status.vrije.cloud -> 94.130.231.155
- Updated Uptime Kuma container to use status.vrije.cloud domain
- HTTPS access via nginx-proxy with Let's Encrypt SSL

Automated Monitor Management:
- Created scripts/add-client-to-monitoring.sh
- Created scripts/remove-client-from-monitoring.sh
- Integrated monitoring into deploy-client.sh (step 5/5)
- Integrated monitoring into destroy-client.sh (step 0/7)
- Deployment now prompts to add monitors after success
- Destruction now prompts to remove monitors before deletion

Email Notification Setup:
- Created docs/uptime-kuma-email-setup.md with complete guide
- SMTP configuration using smtp.strato.com
- Credentials: server@postxsociety.org
- Alerts sent to mail@postxsociety.org

Documentation:
- Updated docs/monitoring.md with new domain
- Added email setup reference
- Replaced all URLs to use status.vrije.cloud

Benefits:
 Friendly domain instead of IP address
 HTTPS access with auto-SSL
 Automated monitoring reminders on deploy/destroy
 Complete email notification guide
 Streamlined workflow for monitor management

Note: Monitor creation/deletion currently manual (API automation planned)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-18 18:55:33 +01:00

69 lines
1.7 KiB
HCL

# DNS Configuration for vrije.cloud using hcloud provider
# The zone already exists in Hetzner Console, so we reference it as a data source
# Reference the existing DNS zone
data "hcloud_zone" "main" {
name = var.base_domain
}
# A Records for client servers (e.g., test.vrije.cloud -> 78.47.191.38)
resource "hcloud_zone_rrset" "client_a" {
for_each = var.clients
zone = data.hcloud_zone.main.name
name = each.value.subdomain
type = "A"
ttl = 300
records = [
{
value = hcloud_server.client[each.key].ipv4_address
comment = "Client ${each.key} server"
}
]
}
# Wildcard A record for each client (e.g., *.test.vrije.cloud for zitadel.test.vrije.cloud)
resource "hcloud_zone_rrset" "client_wildcard" {
for_each = var.clients
zone = data.hcloud_zone.main.name
name = "*.${each.value.subdomain}"
type = "A"
ttl = 300
records = [
{
value = hcloud_server.client[each.key].ipv4_address
comment = "Wildcard for ${each.key} subdomains (Zitadel, Nextcloud, etc)"
}
]
}
# AAAA Records for IPv6 (e.g., test.vrije.cloud IPv6)
resource "hcloud_zone_rrset" "client_aaaa" {
for_each = var.clients
zone = data.hcloud_zone.main.name
name = each.value.subdomain
type = "AAAA"
ttl = 300
records = [
{
value = hcloud_server.client[each.key].ipv6_address
comment = "Client ${each.key} server IPv6"
}
]
}
# Static A record for monitoring server (status.vrije.cloud -> external monitoring server)
resource "hcloud_zone_rrset" "monitoring" {
zone = data.hcloud_zone.main.name
name = "status"
type = "A"
ttl = 300
records = [
{
value = "94.130.231.155"
comment = "Uptime Kuma monitoring server"
}
]
}