orchestration.clouds/ahoskingit/terraform/dns_ahoskingit.tf

212 lines
6.1 KiB
HCL

#Terraform and its management of DNS in route53
#Setup the domain in route53
resource "cloudflare_zone" "ahoskingit_com" {
zone = "ahoskingit.com"
}
resource "cloudflare_record" "ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "ahoskingit.com"
type = "A"
ttl = "1"
value = "${var.site5_ip}"
proxied = "true"
}
resource "cloudflare_record" "ahoskingit_www" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "www"
type = "CNAME"
value = "${cloudflare_record.ahoskingit.name}"
proxied = "true"
}
resource "cloudflare_record" "ahoskingit_influx" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "influx"
type = "CNAME"
value = "home.ahoskingit.com"
proxied = "true"
}
#resource "cloudflare_record" "ahoskingit_wildcard" {
# domain = "ahoskingit.com"
# name = "*"
# type = "A"
# value = "${var.home_ip}"
# proxied = "true" #A records cannot be proxied if wildcard
#}
resource "cloudflare_record" "ahoskingit_plex" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "plex.ahoskingit.com"
type = "CNAME"
value = "home.ahoskingit.com"
proxied = "true"
}
resource "cloudflare_record" "home_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "home"
type = "A"
value = "${var.home_ip}"
proxied = "true"
}
resource "cloudflare_record" "kfa_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "kfa"
type = "A"
value = "${var.kfa_ip}"
}
resource "cloudflare_record" "lab_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "lab"
type = "CNAME"
proxied = true
value = "${cloudflare_record.kfa_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "logs_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "logs"
type = "A"
proxied = true
value = "${var.home_ip}"
}
resource "cloudflare_record" "inventory_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "inventory"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
# resource "cloudflare_record" "requests_plex_ahoskingit" {
# domain = "${cloudflare_zone.ahoskingit_com.zone}"
# name = "requests.plex"
# type = "CNAME"
# proxied = true
# value = "${cloudflare_record.home_ahoskingit.name}"
# }
resource "cloudflare_record" "ns1_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "ns1"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "docs_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "docs"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "cloud_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "cloud"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "goals_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "goals"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "office_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "office"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "support_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "support"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "git_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "git"
type = "A"
value = "${var.home_ip}"
#proxied = "true"
}
resource "cloudflare_record" "gitlab_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "gitlab"
type = "CNAME"
proxied = true
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
}
resource "cloudflare_record" "monitors_ahoskingit" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "monitors"
type = "CNAME"
value = "${cloudflare_record.home_ahoskingit.name}.${cloudflare_zone.ahoskingit_com.zone}"
proxied = true
}
# email MX records for DNS
resource "cloudflare_record" "ahoskingit_com_mx" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "${cloudflare_zone.ahoskingit_com.zone}"
type = "MX"
value = "aspmx.l.google.com"
priority = 1
}
resource "cloudflare_record" "ahoskingit_com_mx1" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "${cloudflare_zone.ahoskingit_com.zone}"
type = "MX"
value = "alt1.aspmx.l.google.com"
priority = 5
}
resource "cloudflare_record" "ahoskingit_com_mx2" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "${cloudflare_zone.ahoskingit_com.zone}"
type = "MX"
value = "alt2.aspmx.l.google.com"
priority = 5
}
resource "cloudflare_record" "ahoskingit_com_mx3" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "${cloudflare_zone.ahoskingit_com.zone}"
type = "MX"
value = "alt3.aspmx.l.google.com"
priority = 10
}
resource "cloudflare_record" "ahoskingit_com_mx4" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "${cloudflare_zone.ahoskingit_com.zone}"
type = "MX"
value = "alt4.aspmx.l.google.com"
priority = 10
}
resource "cloudflare_record" "ahoskingit_com_txt" {
domain = "${cloudflare_zone.ahoskingit_com.zone}"
name = "${cloudflare_zone.ahoskingit_com.zone}"
type = "TXT"
ttl = 120
value = "google-site-verification=8-QKnBQElI58gnygDWcCzvDGRh31c_bFmNMaSd0fCwE"
}