-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathroute53.tf
30 lines (26 loc) · 804 Bytes
/
route53.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
resource "aws_route53_zone" "primary" {
count = "${var.route53_enabled}"
name = "${var.dnsdomain}"
}
resource "aws_route53_record" "www" {
count = "${var.route53_enabled}"
zone_id = "${aws_route53_zone.primary.zone_id}"
name = "www.${var.dnsdomain}"
type = "CNAME"
ttl = "300"
records = ["${var.dnsdomain}"]
}
resource "aws_route53_record" "apex" {
count = "${var.route53_enabled}"
zone_id = "${aws_route53_zone.primary.zone_id}"
name = "${var.dnsdomain}"
type = "A"
alias {
name = "${aws_cloudfront_distribution.distribution.domain_name}"
zone_id = "Z2FDTNDATAQYW2"
evaluate_target_health = false
}
}
output "nameservers to use at your DNS registrar" {
value = "${aws_route53_zone.primary.*.name_servers}"
}