From b5d0f3ff4c8a3e4a5fe7a24b4d04d3d57fd126c8 Mon Sep 17 00:00:00 2001 From: Alexander Hosking Date: Tue, 31 Jan 2017 17:12:46 -0500 Subject: [PATCH] Add ahosking.com DNS --- ahoskingit/terraform/dns_ahosking.tf | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ahoskingit/terraform/dns_ahosking.tf diff --git a/ahoskingit/terraform/dns_ahosking.tf b/ahoskingit/terraform/dns_ahosking.tf new file mode 100644 index 0000000..70990b5 --- /dev/null +++ b/ahoskingit/terraform/dns_ahosking.tf @@ -0,0 +1,50 @@ +#Terraform and its management of DNS in route53 + +#Setup the domain in route53 +resource "aws_route53_zone" "ahosking" { + name = "ahosking.com" +} + +resource "aws_route53_record" "ahosking" { + zone_id = "${aws_route53_zone.ahosking.zone_id}" + name = "ahosking.com" + type = "A" + ttl = "5" + records = ["104.37.195.87"] +} + +resource "aws_route53_record" "ahosking_wildcard" { + zone_id = "${aws_route53_zone.ahosking.zone_id}" + name = "*.ahosking.com" + type = "A" + ttl = "5" + records = ["104.37.195.87"] +} + +resource "aws_route53_record" "ahosking_www" { + zone_id = "${aws_route53_zone.ahosking.zone_id}" + name = "www.ahosking.com" + type = "CNAME" + ttl = "5" + records = ["${aws_route53_record.ahosking.name}"] +} + +# email MX records for DNS +resource "aws_route53_record" "ahosking_mx" { + zone_id = "${aws_route53_zone.ahosking.zone_id}" + name = "${aws_route53_zone.ahosking.name}" + 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"] +} +#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"] +#}