variable "cloudflare_mitchty_net_zoneid" { type = string } resource "cloudflare_record" "ns1_mitchty_net" { zone_id = var.cloudflare_mitchty_net_zoneid name = "@" value = "mitch.ns.cloudflare.com" type = "NS" } resource "cloudflare_record" "ns2_mitchty_net" { zone_id = var.cloudflare_mitchty_net_zoneid name = "@" value = "tegan.ns.cloudflare.com" type = "NS" } resource "cloudflare_record" "root_mitchty_net" { depends_on = [ linode_instance.prod, cloudflare_record.ns1_mitchty_net, cloudflare_record.ns2_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "@" value = linode_instance.prod.ip_address type = "A" ttl = local.dns_ttl } resource "cloudflare_record" "splat_mitchty_net" { depends_on = [ linode_instance.prod, cloudflare_record.ns1_mitchty_net, cloudflare_record.ns2_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "*" value = linode_instance.prod.ip_address type = "A" ttl = local.dns_ttl } # resource "cloudflare_record" "root6_mitchty_net" { # depends_on = [ # linode_instance.prod, # cloudflare_record.ns1_mitchty_net, # cloudflare_record.ns2_mitchty_net ] # zone_id = var.cloudflare_mitchty_net_zoneid # name = "@" # value = local.ipv6 # type = "AAAA" # ttl = local.dns_ttl # } # resource "cloudflare_record" "splat6_mitchty_net" { # depends_on = [ # linode_instance.prod, # cloudflare_record.ns1_mitchty_net, # cloudflare_record.ns2_mitchty_net ] # zone_id = var.cloudflare_mitchty_net_zoneid # name = "*" # value = local.ipv6 # type = "AAAA" # ttl = local.dns_ttl # proxied = true # } resource "cloudflare_record" "home_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "home" value = "24.118.92.50" type = "A" ttl = local.dns_ttl } resource "cloudflare_record" "www_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "www" value = "mitchty.net" type = "CNAME" ttl = local.dns_ttl } resource "cloudflare_record" "git_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "git" value = "mitchty.net" type = "CNAME" ttl = local.dns_ttl } # MX record setup for fastmail dkim/spf on root and all subdomains resource "cloudflare_record" "mx_cname_1_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "fm1._domainkey" value = "fm1.mitchty.net.dkim.fmhosted.net" type = "CNAME" ttl = local.dns_ttl } resource "cloudflare_record" "mx_cname_2_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "fm2._domainkey" value = "fm2.mitchty.net.dkim.fmhosted.net" type = "CNAME" ttl = local.dns_ttl } resource "cloudflare_record" "mx_cname_3_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "fm3._domainkey" value = "fm3.mitchty.net.dkim.fmhosted.net" type = "CNAME" ttl = local.dns_ttl } resource "cloudflare_record" "mx_10_root_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "@" value = "in1-smtp.messagingengine.com" type = "MX" priority = "10" ttl = local.dns_ttl } resource "cloudflare_record" "mx_20_root_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "@" value = "in2-smtp.messagingengine.com" type = "MX" priority = "20" ttl = local.dns_ttl } resource "cloudflare_record" "mx_10_splat_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "*" value = "in1-smtp.messagingengine.com" type = "MX" priority = "10" ttl = local.dns_ttl } resource "cloudflare_record" "mx_20_splat_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "*" value = "in2-smtp.messagingengine.com" type = "MX" priority = "20" ttl = local.dns_ttl } resource "cloudflare_record" "txt_mx_root_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "@" value = "v=spf1 include:spf.messagingengine.com ?all" type = "TXT" ttl = local.dns_ttl } resource "cloudflare_record" "txt_mx_splat_mitchty_net" { depends_on = [ cloudflare_record.root_mitchty_net, cloudflare_record.splat_mitchty_net ] zone_id = var.cloudflare_mitchty_net_zoneid name = "*" value = "v=spf1 include:spf.messagingengine.com ?all" type = "TXT" ttl = local.dns_ttl }