# DNS records for fxhnt.ai zone (Scaleway DNS)

resource "scaleway_domain_record" "git" {
  dns_zone = var.dns_zone
  name     = "git"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

resource "scaleway_domain_record" "grafana" {
  dns_zone = var.dns_zone
  name     = "grafana"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

resource "scaleway_domain_record" "dashboard" {
  dns_zone = var.dns_zone
  name     = "dashboard"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

# fxhnt cockpit primary hostname (renamed from dashboard 2026-06-24). Added live via the Scaleway DNS API first
# to unbreak access; codified here for IaC. NOTE: next `terragrunt apply` must IMPORT this record (it exists in
# the zone but not in TF state) — `terragrunt import scaleway_domain_record.cockpit <zone>/<record_id>` — else
# apply will try to re-create it.
resource "scaleway_domain_record" "cockpit" {
  dns_zone = var.dns_zone
  name     = "cockpit"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

resource "scaleway_domain_record" "api" {
  dns_zone = var.dns_zone
  name     = "api"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

resource "scaleway_domain_record" "minio" {
  dns_zone = var.dns_zone
  name     = "minio"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

resource "scaleway_domain_record" "chat" {
  dns_zone = var.dns_zone
  name     = "chat"
  type     = "A"
  data     = var.git_ip
  ttl      = 300
}

resource "scaleway_domain_record" "mail" {
  dns_zone = var.dns_zone
  name     = "mail"
  type     = "A"
  data     = var.git_ip  # Tailscale proxy — IMAP + admin only, no public MX
  ttl      = 300
}

resource "scaleway_domain_record" "dagster" {
  dns_zone = var.dns_zone
  name     = "dagster"
  type     = "A"
  data     = var.git_ip  # Tailscale proxy — Dagster orchestrator UI (Phase 2E)
  ttl      = 300
}

