From 83ab4fc12a4e627d0dae23b4ad6094d7fa8db963 Mon Sep 17 00:00:00 2001 From: Alexander Hosking Date: Tue, 31 Jan 2017 17:33:15 -0500 Subject: [PATCH] DNS for ITAutomata domains --- ahoskingit/terraform/dns_itautomata.tf | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 ahoskingit/terraform/dns_itautomata.tf diff --git a/ahoskingit/terraform/dns_itautomata.tf b/ahoskingit/terraform/dns_itautomata.tf new file mode 100644 index 0000000..69b62d5 --- /dev/null +++ b/ahoskingit/terraform/dns_itautomata.tf @@ -0,0 +1,61 @@ +#Terraform and its management of DNS in route53 +### ITAutomata.com +#Setup the domain in route53 +resource "aws_route53_zone" "itautomata" { + name = "itautomata.com" +} + +#Route53 DNS entry +resource "aws_route53_record" "itautomata" { + zone_id = "${aws_route53_zone.itautomata.zone_id}" + name = "itautomata.com" + type = "A" + ttl = "5" + records = ["${var.home_ip}"] +} + +resource "aws_route53_record" "www_itautomata" { + zone_id = "${aws_route53_zone.itautomata.zone_id}" + name = "www.itautomata.com" + type = "CNAME" + ttl = "5" + records = ["${aws_route53_record.itautomata_ca.name}"] +} + +resource "aws_route53_record" "wildcard_itautomata" { + zone_id = "${aws_route53_zone.itautomata.zone_id}" + name = "*.itautomata.com" + type = "CNAME" + ttl = "5" + records = ["${aws_route53_record.itautomata_ca.name}"] +} + +### ITAutomata.ca +#Setup the domain in route53 +resource "aws_route53_zone" "itautomata_ca" { + name = "itautomata.ca" +} + +resource "aws_route53_record" "itautomata_ca" { + zone_id = "${aws_route53_zone.itautomata.zone_id}" + name = "www.itautomata.ca" + type = "A" + ttl = "5" + records = ["${var.home_ip}"] +} + +resource "aws_route53_record" "www_itautomata_ca" { + zone_id = "${aws_route53_zone.itautomata.zone_id}" + name = "www.itautomata.ca" + type = "CNAME" + ttl = "5" + records = ["${aws_route53_record.itautomata_ca.name}"] +} + +resource "aws_route53_record" "wildcard_itautomata_ca" { + zone_id = "${aws_route53_zone.itautomata.zone_id}" + name = "*.itautomata.ca" + type = "CNAME" + ttl = "5" + records = ["${aws_route53_record.itautomata_ca.name}"] +}