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