orchestration.clouds/ahoskingit/terraform/dns_ahoskingit.tf

261 lines
7.8 KiB
Terraform
Raw Permalink Normal View History

#Terraform and its management of DNS in Cloudflare
resource "cloudflare_zone" "ahoskingit_com" {
2021-10-13 14:59:43 +00:00
zone = "ahoskingit.com"
plan = "free"
2017-01-31 07:51:16 +00:00
}
2019-06-10 05:54:16 +00:00
resource "cloudflare_record" "ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "ahoskingit.com"
type = "A"
ttl = "1"
value = var.site5_ip
proxied = "true"
2017-01-31 07:51:16 +00:00
}
2019-06-10 05:54:16 +00:00
resource "cloudflare_record" "ahoskingit_www" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "www"
type = "CNAME"
value = cloudflare_record.ahoskingit.name
proxied = "true"
2017-01-31 17:43:56 +00:00
}
resource "cloudflare_record" "ahoskingit_influx" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "influx"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
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" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "plex.ahoskingit.com"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
2017-01-31 07:51:16 +00:00
}
2020-07-24 05:46:48 +00:00
resource "cloudflare_record" "ahoskingit_recipes" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "recipes.ahoskingit.com"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
2020-07-24 05:46:48 +00:00
}
2021-01-08 05:14:41 +00:00
resource "cloudflare_record" "ahoskingit_food" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "food.ahoskingit.com"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
2021-01-08 05:14:41 +00:00
}
2020-10-16 14:42:54 +00:00
resource "cloudflare_record" "ahoskingit_jumbledev" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "jumbledev.ahoskingit.com"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
2020-10-16 14:42:54 +00:00
}
resource "cloudflare_record" "home_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "home"
type = "A"
value = var.home_ip
proxied = "true"
2017-06-09 23:37:49 +00:00
}
### Home Subdomains ###
resource "cloudflare_record" "smart_home_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "smart"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
}
resource "cloudflare_record" "temps_home_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "temperatures"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
# value = var.home_ip
proxied = "true"
}
### END Home Subdomains ###
2017-06-09 23:37:49 +00:00
resource "cloudflare_record" "kfa_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "kfa"
type = "A"
value = var.kfa_ip
2017-01-31 07:51:16 +00:00
}
resource "cloudflare_record" "lab_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "lab"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.kfa_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-01-31 07:51:16 +00:00
}
resource "cloudflare_record" "logs_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "logs"
type = "A"
proxied = true
value = var.home_ip
2019-05-14 12:08:45 +00:00
}
resource "cloudflare_record" "inventory_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "inventory"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-01-31 22:22:57 +00:00
}
# resource "cloudflare_record" "requests_plex_ahoskingit" {
# zone_id = cloudflare_zone.ahoskingit_com
# name = "requests.plex"
# type = "CNAME"
# proxied = true
# value = "cloudflare_record.home_ahoskingit.name"
# }
2017-01-31 22:22:57 +00:00
resource "cloudflare_record" "ns1_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "ns1"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-01-31 22:22:57 +00:00
}
resource "cloudflare_record" "docs_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "docs"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-01-31 22:22:57 +00:00
}
resource "cloudflare_record" "cloud_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "cloud"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-01-31 22:22:57 +00:00
}
resource "cloudflare_record" "goals_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "goals"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2019-02-09 06:08:52 +00:00
}
resource "cloudflare_record" "office_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "office"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-06-09 23:37:49 +00:00
}
resource "cloudflare_record" "support_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "support"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2017-01-31 22:22:57 +00:00
}
resource "cloudflare_record" "git_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "git"
2021-10-14 17:58:56 +00:00
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
2017-01-31 22:22:57 +00:00
}
resource "cloudflare_record" "gitlab_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "gitlab"
type = "CNAME"
proxied = true
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
2018-02-12 10:58:22 +00:00
}
resource "cloudflare_record" "monitors_ahoskingit" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "monitors"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = true
2017-01-31 22:22:57 +00:00
}
2017-01-31 07:51:16 +00:00
2017-01-31 17:43:56 +00:00
# email MX records for DNS
resource "cloudflare_record" "ahoskingit_com_mx" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = cloudflare_zone.ahoskingit_com.zone
type = "MX"
value = "aspmx.l.google.com"
priority = 1
}
resource "cloudflare_record" "ahoskingit_com_mx1" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = cloudflare_zone.ahoskingit_com.zone
type = "MX"
value = "alt1.aspmx.l.google.com"
priority = 5
}
resource "cloudflare_record" "ahoskingit_com_mx2" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = cloudflare_zone.ahoskingit_com.zone
type = "MX"
value = "alt2.aspmx.l.google.com"
priority = 5
}
resource "cloudflare_record" "ahoskingit_com_mx3" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = cloudflare_zone.ahoskingit_com.zone
type = "MX"
value = "alt3.aspmx.l.google.com"
priority = 10
}
resource "cloudflare_record" "ahoskingit_com_mx4" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = cloudflare_zone.ahoskingit_com.zone
type = "MX"
value = "alt4.aspmx.l.google.com"
priority = 10
}
resource "cloudflare_record" "ahoskingit_com_txt" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = cloudflare_zone.ahoskingit_com.zone
type = "TXT"
ttl = 120
value = "google-site-verification=8-QKnBQElI58gnygDWcCzvDGRh31c_bFmNMaSd0fCwE"
2020-07-24 05:46:48 +00:00
}
2021-04-04 05:53:45 +00:00
resource "cloudflare_record" "ahoskingit_house" {
2021-10-13 14:59:43 +00:00
zone_id = cloudflare_zone.ahoskingit_com.id
name = "house.ahoskingit.com"
type = "CNAME"
value = join(".", [cloudflare_record.home_ahoskingit.name, cloudflare_zone.ahoskingit_com.zone])
proxied = "true"
2021-04-04 05:53:45 +00:00
}