-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdns.tf
28 lines (24 loc) · 833 Bytes
/
dns.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
data "aws_route53_zone" "zone" {
zone_id = "${var.hosted_zone_id}"
}
# Primary domain DNS record
resource "aws_route53_record" "root" {
zone_id = "${data.aws_route53_zone.zone.zone_id}"
name = "${data.aws_route53_zone.zone.name}"
type = "A"
alias {
name = "${aws_cloudfront_distribution.dist.domain_name}"
zone_id = "${aws_cloudfront_distribution.dist.hosted_zone_id}"
evaluate_target_health = false
}
}
resource "aws_route53_record" "subdomain" {
zone_id = "${data.aws_route53_zone.zone.zone_id}"
name = "${local.subdomain_fqdn}"
type = "A"
alias {
name = "${aws_cloudfront_distribution.dist.domain_name}"
zone_id = "${aws_cloudfront_distribution.dist.hosted_zone_id}"
evaluate_target_health = false
}
}