orchestration.clouds/ahoskingit/terraform/dns_ahosking.tf

85 lines
2.1 KiB
Terraform
Raw Normal View History

2017-01-31 22:12:46 +00:00
#Terraform and its management of DNS in route53
#Setup the domain in route53
resource "aws_route53_zone" "ahosking" {
name = "ahosking.com"
}
2021-01-12 03:46:49 +00:00
resource "cloudflare_zone" "ahosking_com" {
zone = "ahosking.com"
plan = "free"
}
resource "cloudflare_record" "ahosking" {
zone_id = cloudflare_zone.ahosking_com.id
2017-01-31 22:12:46 +00:00
name = "ahosking.com"
type = "A"
ttl = "1"
value = var.site5_ip
2017-01-31 22:12:46 +00:00
}
resource "cloudflare_record" "ahosking_wildcard" {
zone_id = cloudflare_zone.ahosking_com.id
2017-01-31 22:12:46 +00:00
name = "*.ahosking.com"
type = "A"
ttl = "1"
value = var.site5_ip
2017-01-31 22:12:46 +00:00
}
resource "cloudflare_record" "ahosking_www" {
zone_id = cloudflare_zone.ahosking_com.id
2017-01-31 22:12:46 +00:00
name = "www.ahosking.com"
type = "CNAME"
ttl = "1"
value = cloudflare_record.ahosking.name
2017-01-31 22:12:46 +00:00
}
# email MX value for DNS
resource "cloudflare_record" "ahosking_mx" {
zone_id = cloudflare_zone.ahosking_com.id
name = cloudflare_zone.ahosking_com.zone
2017-01-31 22:12:46 +00:00
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"
}