WIP: Migrate DNS to Gandi #175

Draft
jake wants to merge 7 commits from gandi-dns into master
2 changed files with 218 additions and 233 deletions
Showing only changes of commit f1ba63818b - Show all commits

View file

@ -63,288 +63,273 @@ resource "gandi_livedns_record" "jakehowardtech_dmarc" {
] ]
} }
### resource "gandi_livedns_record" "jakehowardtech_wallabag" {
zone = gandi_livedns_domain.jakehowardtech.id
resource "cloudflare_zone" "jakehowardtech" {
zone = "jakehoward.tech"
}
resource "cloudflare_record" "jakehowardtech_mx1" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "@"
value = "in1-smtp.messagingengine.com"
type = "MX"
priority = 10
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_mx2" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "@"
value = "in2-smtp.messagingengine.com"
type = "MX"
priority = 20
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_txt" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "@"
value = "v=spf1 include:spf.messagingengine.com -all"
type = "TXT"
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_dkim_fm1" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "fm1._domainkey"
value = "fm1.jakehoward.tech.dkim.fmhosted.com"
type = "CNAME"
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_dkim_fm2" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "fm2._domainkey"
value = "fm2.jakehoward.tech.dkim.fmhosted.com"
type = "CNAME"
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_dkim_fm3" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "fm3._domainkey"
value = "fm3.jakehoward.tech.dkim.fmhosted.com"
type = "CNAME"
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_dmarc" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "_dmarc"
value = "v=DMARC1; p=quarantine; ruf=mailto:dmarc-report@jakehoward.tech;"
type = "TXT"
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_wallabag" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "wallabag" name = "wallabag"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_ttrss" { resource "gandi_livedns_record" "jakehowardtech_ttrss" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "tt-rss" name = "tt-rss"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_speed" { resource "gandi_livedns_record" "jakehowardtech_speed" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "speed" name = "speed"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_quassel" { resource "gandi_livedns_record" "jakehowardtech_quassel" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "quassel" name = "quassel"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_media" { resource "gandi_livedns_record" "jakehowardtech_media" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "media" name = "media"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_matrix" { resource "gandi_livedns_record" "jakehowardtech_matrix" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "matrix" name = "matrix"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_intersect" { resource "gandi_livedns_record" "jakehowardtech_intersect" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "intersect" name = "intersect"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_calibre" { resource "gandi_livedns_record" "jakehowardtech_calibre" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "calibre" name = "calibre"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_homeassistant" { resource "gandi_livedns_record" "jakehowardtech_homeassistant" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "homeassistant" name = "homeassistant"
value = gandi_livedns_record.sys_domain_pve_private.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve_private.href
]
} }
resource "cloudflare_record" "jakehowardtech_grafana" { resource "gandi_livedns_record" "jakehowardtech_grafana" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "grafana" name = "grafana"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_vaultwarden" { resource "gandi_livedns_record" "jakehowardtech_vaultwarden" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "vaultwarden" name = "vaultwarden"
value = gandi_livedns_record.sys_domain_pve_private.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve_private.href
]
} }
resource "cloudflare_record" "jakehowardtech_tandoor" { resource "gandi_livedns_record" "jakehowardtech_recipes" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "recipes" name = "recipes"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_mailgun_spf" { resource "gandi_livedns_record" "jakehowardtech_mailgun_spf" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "mg" name = "mg"
value = "v=spf1 include:mailgun.org -all"
type = "TXT" type = "TXT"
ttl = 1 ttl = 3600
values = [
"\"v=spf1 include:mailgun.org -all\""
]
} }
resource "cloudflare_record" "jakehowardtech_mailgun_dkim" { resource "gandi_livedns_record" "jakehowardtech_mailgun_dkim" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "s1._domainkey.mg" name = "s1._domainkey.mg"
value = "k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4E4cv86U+sFUjgLys26ZLccTghzGfHiFpitWdFg68lGXG63aoG2/+9bgKVT0ZBG7bjPvj6Kyj4N3TIe4oCJo2saVvtsNK1pvZkOadaBPgjzKeRvBaw48ZatUGKoV7q1NCa0kXAfiJleF7bMvbt8rYDmBljr/BG6TtZYPt6XgoZyh8HHXjv/1L6WT3JBVQ8q5UtqVRVujXNHf57FmJTOJpvs0bKn/6TUaXYZmt5z3jpDhc/HfmkzVV22AwRf9jn7kgKkgaKpkvfSL8gtYNn5oyfS0Y9W9x9ntqb4g72RCbynMppQb1uwxbIuWRVOp0un0koQDm3C8ZzhOOYAwe58BYQIDAQAB"
type = "TXT" type = "TXT"
ttl = 1 ttl = 3600
values = [
"\"k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4E4cv86U+sFUjgLys26ZLccTghzGfHiFpitWdFg68lGXG63aoG2/+9bgKVT0ZBG7bjPvj6Kyj4N3TIe4oCJo2saVvtsNK1pvZkOadaBPgjzKeRvBaw48ZatUGKoV7q1NCa0kXAfiJleF7bMvbt8rYDmBljr/BG6TtZYPt6XgoZyh8HHXjv/1L6WT3JBVQ8q5UtqVRVujXNHf57FmJTOJpvs0bKn/6TUaXYZmt5z3jpDhc/HfmkzVV22AwRf9jn7kgKkgaKpkvfSL8gtYNn5oyfS0Y9W9x9ntqb4g72RCbynMppQb1uwxbIuWRVOp0un0koQDm3C8ZzhOOYAwe58BYQIDAQAB\""
]
} }
resource "cloudflare_record" "jakehowardtech_mailgun_dmarc" { resource "gandi_livedns_record" "jakehowardtech_mailgun_dmarc" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "_dmarc.mg" name = "_dmarc.mg"
value = "v=DMARC1; p=quarantine; ruf=mailto:dmarc-report@jakehoward.tech;"
type = "TXT" type = "TXT"
ttl = 1 ttl = 3600
values = [
"\"v=DMARC1; p=quarantine; ruf=mailto:dmarc-report@jakehoward.tech;\""
]
} }
resource "cloudflare_record" "jakehowardtech_matrix_admin" { resource "gandi_livedns_record" "jakehowardtech_synapse_admin" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "synapse-admin" name = "synapse-admin"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
# Cloudflare supports CNAME flattening - so this is ok resource "gandi_livedns_record" "jakehowardtech_apex" {
resource "cloudflare_record" "jakehowardtech_apex" { zone = gandi_livedns_domain.jakehowardtech.id
zone_id = cloudflare_zone.jakehowardtech.id
name = "@" name = "@"
value = gandi_livedns_record.sys_domain_walker.href type = "ALIAS"
type = "CNAME" ttl = 3600
ttl = 1 values = [
gandi_livedns_record.sys_domain_walker.href
]
} }
resource "cloudflare_record" "jakehowardtech_collabora" { resource "gandi_livedns_record" "jakehowardtech_collabora" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "collabora" name = "collabora"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_tasks" { resource "gandi_livedns_record" "jakehowardtech_tasks" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "tasks" name = "tasks"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_auth" { resource "gandi_livedns_record" "jakehowardtech_auth" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "auth" name = "auth"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_minio" { resource "gandi_livedns_record" "jakehowardtech_minio" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "minio" name = "minio"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_s3" { resource "gandi_livedns_record" "jakehowardtech_s3" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "s3" name = "s3"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_ntfy" { resource "gandi_livedns_record" "jakehowardtech_ntfy" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "ntfy" name = "ntfy"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_headscale" { resource "gandi_livedns_record" "jakehowardtech_headscale" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "headscale" name = "headscale"
value = gandi_livedns_record.sys_domain_casey.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_casey.href
]
} }
resource "cloudflare_record" "jakehowardtech_slides" { resource "gandi_livedns_record" "jakehowardtech_slides" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "slides" name = "slides"
value = gandi_livedns_record.sys_domain_walker.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_walker.href
]
} }
resource "cloudflare_record" "jakehowardtech_uptime" { resource "gandi_livedns_record" "jakehowardtech_uptime" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "uptime" name = "uptime"
value = gandi_livedns_record.sys_domain_pve.href
type = "CNAME" type = "CNAME"
ttl = 1 ttl = 3600
values = [
gandi_livedns_record.sys_domain_pve.href
]
} }
resource "cloudflare_record" "jakehowardtech_caa" { resource "gandi_livedns_record" "jakehowardtech_caa" {
zone_id = cloudflare_zone.jakehowardtech.id zone = gandi_livedns_domain.jakehowardtech.id
name = "@" name = "@"
type = "CAA" type = "CAA"
ttl = 1 ttl = 3600
values = [
data = { "0 issue \"letsencrypt.org\"",
tag = "issue" "0 wildissue \"letsencrypt.org\"",
flags = 0 ]
value = "letsencrypt.org"
}
} }

View file

@ -108,7 +108,7 @@ resource "gandi_livedns_record" "theorangeonenet_dmarc_report" {
gandi_livedns_domain.theorangeonenet.name, gandi_livedns_domain.theorangeonenet.name,
gandi_livedns_domain.jakehowardtech.name, gandi_livedns_domain.jakehowardtech.name,
gandi_livedns_record.theorangeonenet_mailgun_spf.href, gandi_livedns_record.theorangeonenet_mailgun_spf.href,
cloudflare_record.jakehowardtech_mailgun_spf.hostname, gandi_livedns_record.jakehowardtech_mailgun_spf.href,
]) ])
zone = gandi_livedns_domain.theorangeonenet.id zone = gandi_livedns_domain.theorangeonenet.id