Skip to content

Commit

Permalink
Added Route 53 AAAA records when var.is_ipv6_enabled is true (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin A. Timmers <[email protected]>
  • Loading branch information
JATimmers and Justin A. Timmers authored Jun 7, 2023
1 parent bc743f7 commit 733a6eb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions website.tf
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,22 @@ resource "aws_route53_record" "website_cloudfront_record" {
}
}

resource "aws_route53_record" "website_cloudfront_record_ipv6" {
provider = aws.main

count = (var.is_ipv6_enabled && var.create_route53_website_records) ? 1 : 0

zone_id = var.create_route53_hosted_zone ? aws_route53_zone.hosted_zone[0].zone_id : var.route53_hosted_zone_id
name = local.website_bucket_name
type = "AAAA"

alias {
name = aws_cloudfront_distribution.website.domain_name
zone_id = aws_cloudfront_distribution.website.hosted_zone_id
evaluate_target_health = false
}
}

resource "aws_route53_record" "www_website_record" {
provider = aws.main

Expand All @@ -261,3 +277,19 @@ resource "aws_route53_record" "www_website_record" {
evaluate_target_health = false
}
}

resource "aws_route53_record" "www_website_record_ipv6" {
provider = aws.main

count = (var.is_ipv6_enabled && var.www_website_redirect_enabled && var.create_route53_website_records) ? 1 : 0

zone_id = var.create_route53_hosted_zone ? aws_route53_zone.hosted_zone[0].zone_id : var.route53_hosted_zone_id
name = local.www_website_bucket_name
type = "AAAA"

alias {
name = aws_cloudfront_distribution.website.domain_name
zone_id = aws_cloudfront_distribution.website.hosted_zone_id
evaluate_target_health = false
}
}

0 comments on commit 733a6eb

Please sign in to comment.