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"
|
|
|
|
}
|
|
|
|
|
2021-01-12 04:11:44 +00:00
|
|
|
resource "cloudflare_record" "ahosking" {
|
|
|
|
zone_id = cloudflare_zone.ahosking_com.id
|
2017-01-31 22:12:46 +00:00
|
|
|
name = "ahosking.com"
|
|
|
|
type = "A"
|
2021-01-12 04:11:44 +00:00
|
|
|
ttl = "1"
|
|
|
|
value = var.site5_ip
|
2017-01-31 22:12:46 +00:00
|
|
|
}
|
|
|
|
|
2021-01-12 04:11:44 +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"
|
2021-01-12 04:11:44 +00:00
|
|
|
ttl = "1"
|
2021-10-12 04:40:12 +00:00
|
|
|
value = var.home_ip
|
2017-01-31 22:12:46 +00:00
|
|
|
}
|
|
|
|
|
2021-01-12 04:11:44 +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"
|
2021-01-12 04:11:44 +00:00
|
|
|
ttl = "1"
|
|
|
|
value = cloudflare_record.ahosking.name
|
2017-01-31 22:12:46 +00:00
|
|
|
}
|
|
|
|
|
2021-01-12 04:11:44 +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"
|
2021-01-12 04:11:44 +00:00
|
|
|
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
|
2019-12-29 07:15:42 +00:00
|
|
|
type = "TXT"
|
2021-01-12 04:11:44 +00:00
|
|
|
ttl = 60
|
|
|
|
value = "google-site-verification=8-QKnBQElI58gnygDWcCzvDGRh31c_bFmNMaSd0fCwE"
|
2019-12-29 07:15:42 +00:00
|
|
|
}
|