From 6fb3d3046bc82d01d91b84b8cabe18af59f3339a Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Sat, 26 Oct 2019 19:52:21 -0400 Subject: [PATCH] Add AAAA records for native ipv6 reach-ability Signed-off-by: Collin J. Doering --- infra/main.tf | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/infra/main.tf b/infra/main.tf index 17353cc..f7cb739 100644 --- a/infra/main.tf +++ b/infra/main.tf @@ -168,6 +168,18 @@ resource "aws_route53_record" "static" { } } +resource "aws_route53_record" "static_ipv6" { + zone_id = data.aws_route53_zone.external.zone_id + name = "${local.domain}." + type = "AAAA" + + alias { + name = aws_cloudfront_distribution.cdn.domain_name + zone_id = aws_cloudfront_distribution.cdn.hosted_zone_id + evaluate_target_health = true + } +} + resource "aws_route53_record" "static_redirect" { count = var.enable_naked_domain ? 0 : 1 @@ -182,6 +194,20 @@ resource "aws_route53_record" "static_redirect" { } } +resource "aws_route53_record" "static_redirect_ipv6" { + count = var.enable_naked_domain ? 0 : 1 + + zone_id = data.aws_route53_zone.external.zone_id + name = "${local.naked_domain}." + type = "AAAA" + + alias { + name = aws_cloudfront_distribution.cdn_redirect[0].domain_name + zone_id = aws_cloudfront_distribution.cdn_redirect[0].hosted_zone_id + evaluate_target_health = true + } +} + resource "aws_s3_bucket_policy" "static_policy" { bucket = aws_s3_bucket.static.id policy = data.template_file.s3_origin_policy.rendered @@ -382,4 +408,3 @@ SCRIPT } } -