blob: 30d42fafd8c1c412abf1ed550d6a6609f322e2fb (
plain) (
tree)
|
|
# Cloudflare DNS records
# www
variable "homelab_www_domain" {
default = "clarkzjw.cc"
}
variable "homelab_www_ip" {
default = "8.8.8.8"
}
resource "cloudflare_record" "main" {
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
name = var.homelab_www_domain
value = var.homelab_www_ip
type = "A"
ttl = 1
proxied = true
}
# bt
resource "cloudflare_record" "bt" {
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
name = "bt.${var.homelab_main_domain}"
value = "${cloudflare_argo_tunnel.atlas_main_tunnel.id}.cfargotunnel.com"
type = "CNAME"
proxied = true
}
# EdgeRouterX
resource "cloudflare_record" "edgerouterx" {
name = "edgerouterx.${var.homelab_main_domain}"
type = "CNAME"
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
value = "${cloudflare_argo_tunnel.atlas_main_tunnel.id}.cfargotunnel.com"
proxied = true
}
# notify
# DNS config for Mailgun
resource "cloudflare_record" "notify_SPF" {
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
# type = "SPF" causes DNS Validation Error (1004)
# https://github.com/cloudflare/terraform-provider-cloudflare/issues/1473
type = "TXT"
name = "notify.${var.homelab_main_domain}"
value = "v=spf1 include:mailgun.org ~all"
ttl = 1
}
resource "cloudflare_record" "notify_DKIM" {
name = "pic._domainkey.notify.${var.homelab_main_domain}"
type = "TXT"
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
value = var.homelab_notify_DKIM
}
resource "cloudflare_record" "notify_CNAME" {
name = "email.notify.${var.homelab_main_domain}"
type = "CNAME"
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
value = "mailgun.org"
}
resource "cloudflare_record" "notify_MX_a" {
name = "notify.${var.homelab_main_domain}"
type = "MX"
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
value = "mxa.mailgun.org"
priority = 10
}
resource "cloudflare_record" "notify_MX_b" {
name = "notify.${var.homelab_main_domain}"
type = "MX"
zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id
value = "mxb.mailgun.org"
priority = 10
}
|