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}"] +}