orchestration.clouds/ahoskingit/terraform/dns_ahosking.tf
2021-01-11 23:11:44 -05:00

85 lines
2.1 KiB
HCL

#Terraform and its management of DNS in route53
#Setup the domain in route53
resource "aws_route53_zone" "ahosking" {
name = "ahosking.com"
}
resource "cloudflare_zone" "ahosking_com" {
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
}
resource "cloudflare_record" "ahosking_wildcard" {
zone_id = cloudflare_zone.ahosking_com.id
name = "*.ahosking.com"
type = "A"
ttl = "1"
value = var.site5_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
}
# 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
}
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
}
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
}
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
}
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
}
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"
}