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"
|
|
|
|
}
|
|
|
|
|
2017-01-31 22:12:46 +00:00
|
|
|
resource "aws_route53_record" "ahosking" {
|
2019-12-29 07:15:42 +00:00
|
|
|
zone_id = aws_route53_zone.ahosking.zone_id
|
2017-01-31 22:12:46 +00:00
|
|
|
name = "ahosking.com"
|
|
|
|
type = "A"
|
|
|
|
ttl = "5"
|
2019-12-29 07:15:42 +00:00
|
|
|
records = [var.site5_ip]
|
2017-01-31 22:12:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_route53_record" "ahosking_wildcard" {
|
2019-12-29 07:15:42 +00:00
|
|
|
zone_id = aws_route53_zone.ahosking.zone_id
|
2017-01-31 22:12:46 +00:00
|
|
|
name = "*.ahosking.com"
|
|
|
|
type = "A"
|
|
|
|
ttl = "5"
|
2019-12-29 07:15:42 +00:00
|
|
|
records = [var.site5_ip]
|
2017-01-31 22:12:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_route53_record" "ahosking_www" {
|
2019-12-29 07:15:42 +00:00
|
|
|
zone_id = aws_route53_zone.ahosking.zone_id
|
2017-01-31 22:12:46 +00:00
|
|
|
name = "www.ahosking.com"
|
|
|
|
type = "CNAME"
|
|
|
|
ttl = "5"
|
2019-12-29 07:15:42 +00:00
|
|
|
records = [aws_route53_record.ahosking.name]
|
2017-01-31 22:12:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# email MX records for DNS
|
|
|
|
resource "aws_route53_record" "ahosking_mx" {
|
2019-12-29 07:15:42 +00:00
|
|
|
zone_id = aws_route53_zone.ahosking.zone_id
|
|
|
|
name = aws_route53_zone.ahosking.name
|
2017-01-31 22:12:46 +00:00
|
|
|
type = "MX"
|
|
|
|
ttl = "60"
|
|
|
|
records = ["1 ASPMX.L.GOOGLE.COM",
|
|
|
|
"5 ALT1.ASPMX.L.GOOGLE.COM",
|
|
|
|
"5 ALT2.ASPMX.L.GOOGLE.COM",
|
|
|
|
"10 ALT3.ASPMX.L.GOOGLE.COM",
|
|
|
|
"10 ALT4.ASPMX.L.GOOGLE.COM"]
|
|
|
|
}
|
2019-12-29 07:15:42 +00:00
|
|
|
resource "aws_route53_record" "ahosking_txt" {
|
|
|
|
zone_id = aws_route53_zone.ahosking.zone_id
|
|
|
|
name = aws_route53_zone.ahosking.name
|
|
|
|
type = "TXT"
|
|
|
|
ttl = "60"
|
|
|
|
records = ["google-site-verification=8-QKnBQElI58gnygDWcCzvDGRh31c_bFmNMaSd0fCwE"]
|
|
|
|
}
|