-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathr53.tf
30 lines (28 loc) · 1.1 KB
/
r53.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_record" "www" {
count = var.site_prefix == "www" ? 0 : 1
zone_id = var.hosted_zone_id
name = "www.${var.site_prefix}.${var.site_domain}"
type = "CNAME"
ttl = "600"
records = ["${var.site_prefix}${var.site_prefix == "" ? "" : "."}${var.site_domain}"]
}
resource "aws_route53_record" "apex" {
zone_id = var.hosted_zone_id
name = "${var.site_prefix}${var.site_prefix == "" ? "" : "."}${var.site_domain}"
type = "A"
alias {
name = module.cloudfront.wordpress_cloudfront_distribution_domain_name
zone_id = module.cloudfront.wordpress_cloudfront_distrubtion_hostedzone_id
evaluate_target_health = false
}
}
resource "aws_route53_record" "apex_aaaa" {
zone_id = var.hosted_zone_id
name = "${var.site_prefix}${var.site_prefix == "" ? "" : "."}${var.site_domain}"
type = "AAAA"
alias {
name = module.cloudfront.wordpress_cloudfront_distribution_domain_name
zone_id = module.cloudfront.wordpress_cloudfront_distrubtion_hostedzone_id
evaluate_target_health = false
}
}