diff --git a/ahoskingit/terraform/dns_ahosking.tf b/ahoskingit/terraform/dns_ahosking.tf index 373238f..2ead6d5 100644 --- a/ahoskingit/terraform/dns_ahosking.tf +++ b/ahoskingit/terraform/dns_ahosking.tf @@ -2,83 +2,119 @@ #Setup the domain in route53 resource "aws_route53_zone" "ahosking" { - name = "ahosking.com" + name = "ahosking.com" } resource "cloudflare_zone" "ahosking_com" { - zone = "ahosking.com" - plan = "free" + zone = "ahosking.com" + plan = "free" } resource "cloudflare_record" "ahosking" { - zone_id = cloudflare_zone.ahosking_com.id - name = "ahosking.com" - type = "A" - ttl = "1" - value = var.site5_ip + zone_id = cloudflare_zone.ahosking_com.id + name = "ahosking.com" + type = "A" + ttl = "1" + value = var.site5_ip } resource "cloudflare_record" "ahosking_wildcard" { - zone_id = cloudflare_zone.ahosking_com.id - name = "*.ahosking.com" - type = "A" - ttl = "1" - value = var.site5_ip + zone_id = cloudflare_zone.ahosking_com.id + name = "*.ahosking.com" + type = "A" + ttl = "1" + value = var.home_ip } resource "cloudflare_record" "ahosking_www" { - zone_id = cloudflare_zone.ahosking_com.id - name = "www.ahosking.com" - type = "CNAME" - ttl = "1" - value = cloudflare_record.ahosking.name + zone_id = cloudflare_zone.ahosking_com.id + name = "www.ahosking.com" + type = "CNAME" + ttl = "1" + value = cloudflare_record.ahosking.name + proxied = "true" +} + +resource "cloudflare_record" "ahosking_home" { + zone_id = cloudflare_zone.ahosking_com.id + name = "home" + type = "A" + ttl = "1" + value = var.home_ip +} + +resource "cloudflare_record" "ahosking_code" { + zone_id = cloudflare_zone.ahosking_com.id + name = "code" + type = "CNAME" + ttl = "1" + value = cloudflare_record.ahosking_home.name + proxied = "true" +} + +resource "cloudflare_record" "ahosking_ombi" { + zone_id = cloudflare_zone.ahosking_com.id + name = "ombi" + type = "CNAME" + ttl = "1" + value = cloudflare_record.ahosking_home.name + proxied = "true" +} + +resource "cloudflare_record" "ahosking_radarr" { + zone_id = cloudflare_zone.ahosking_com.id + name = "radarr" + type = "CNAME" + ttl = "1" + value = cloudflare_record.ahosking_home.name + proxied = "true" } # email MX value for DNS resource "cloudflare_record" "ahosking_mx" { - zone_id = cloudflare_zone.ahosking_com.id - name = cloudflare_zone.ahosking_com.zone - type = "MX" - ttl = "60" - value = "aspmx.l.google.com" - priority = 1 + zone_id = cloudflare_zone.ahosking_com.id + name = cloudflare_zone.ahosking_com.zone + type = "MX" + ttl = "60" + value = "aspmx.l.google.com" + priority = 1 } resource "cloudflare_record" "ahosking_mx1" { - zone_id = cloudflare_zone.ahosking_com.id - name = cloudflare_zone.ahosking_com.zone - type = "MX" - ttl = "60" - value = "alt1.aspmx.l.google.com" - priority = 5 + zone_id = cloudflare_zone.ahosking_com.id + name = cloudflare_zone.ahosking_com.zone + type = "MX" + ttl = "60" + value = "alt1.aspmx.l.google.com" + priority = 5 } resource "cloudflare_record" "ahosking_mx2" { - zone_id = cloudflare_zone.ahosking_com.id - name = cloudflare_zone.ahosking_com.zone - type = "MX" - ttl = "60" - value = "alt2.aspmx.l.google.com" - priority = 5 + zone_id = cloudflare_zone.ahosking_com.id + name = cloudflare_zone.ahosking_com.zone + type = "MX" + ttl = "60" + value = "alt2.aspmx.l.google.com" + priority = 5 } resource "cloudflare_record" "ahosking_mx3" { - zone_id = cloudflare_zone.ahosking_com.id - name = cloudflare_zone.ahosking_com.zone - type = "MX" - ttl = "60" - value = "alt3.aspmx.l.google.com" - priority = 10 + zone_id = cloudflare_zone.ahosking_com.id + name = cloudflare_zone.ahosking_com.zone + type = "MX" + ttl = "60" + value = "alt3.aspmx.l.google.com" + priority = 10 } resource "cloudflare_record" "ahosking_mx4" { - zone_id = cloudflare_zone.ahosking_com.id - name = cloudflare_zone.ahosking_com.zone - type = "MX" - ttl = "60" - value = "alt4.aspmx.l.google.com" - priority = 10 + zone_id = cloudflare_zone.ahosking_com.id + name = cloudflare_zone.ahosking_com.zone + type = "MX" + ttl = "60" + value = "alt4.aspmx.l.google.com" + priority = 10 } resource "cloudflare_record" "ahosking_txt" { - zone_id = cloudflare_zone.ahosking_com.id - name = cloudflare_zone.ahosking_com.zone - type = "TXT" - ttl = 60 - value = "google-site-verification=8-QKnBQElI58gnygDWcCzvDGRh31c_bFmNMaSd0fCwE" + zone_id = cloudflare_zone.ahosking_com.id + name = cloudflare_zone.ahosking_com.zone + type = "TXT" + ttl = 60 + value = "google-site-verification=8-QKnBQElI58gnygDWcCzvDGRh31c_bFmNMaSd0fCwE" }