File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
resource "aws_route53_record" "www" {
2
+ count = var. site_prefix == " www" ? 0 : 1
2
3
zone_id = var. hosted_zone_id
3
- name = " www"
4
+ name = " www. ${ var . site_prefix } . ${ var . site_domain } "
4
5
type = " CNAME"
5
6
ttl = " 600"
6
- records = [var . site_domain ]
7
+ records = [" ${ var . site_prefix } ${ var . site_prefix == " " ? " " : " . " } ${ var . site_domain } " ]
7
8
}
8
9
9
10
resource "aws_route53_record" "apex" {
10
11
zone_id = var. hosted_zone_id
11
- name = var. site_domain
12
+ name = " ${ var . site_prefix } ${ var . site_prefix == " " ? " " : " . " } ${ var . site_domain } "
12
13
type = " A"
13
14
alias {
14
15
name = module. cloudfront . wordpress_cloudfront_distribution_domain_name
15
16
zone_id = module. cloudfront . wordpress_cloudfront_distrubtion_hostedzone_id
16
17
evaluate_target_health = false
17
18
}
18
19
}
20
+
21
+ resource "aws_route53_record" "apex_aaaa" {
22
+ zone_id = var. hosted_zone_id
23
+ name = " ${ var . site_prefix } ${ var . site_prefix == " " ? " " : " ." } ${ var . site_domain } "
24
+ type = " AAAA"
25
+ alias {
26
+ name = module. cloudfront . wordpress_cloudfront_distribution_domain_name
27
+ zone_id = module. cloudfront . wordpress_cloudfront_distrubtion_hostedzone_id
28
+ evaluate_target_health = false
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments