From a4f8c87e7d4c1cfbfde33a254eeaa9536e727acb Mon Sep 17 00:00:00 2001 From: kuannie1 Date: Tue, 19 Nov 2024 15:16:01 -0800 Subject: [PATCH 1/2] fix: use right if else --- aws-cloudfront-domain-redirect/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-cloudfront-domain-redirect/main.tf b/aws-cloudfront-domain-redirect/main.tf index 124ec4f0..43250fb6 100644 --- a/aws-cloudfront-domain-redirect/main.tf +++ b/aws-cloudfront-domain-redirect/main.tf @@ -9,7 +9,7 @@ locals { } resource "aws_s3_bucket" "redirect_bucket" { - bucket = (var.redirect_bucket_name == null) : "redirect-${var.source_domain}-to-${var.target_domain}" ? var.redirect_bucket_name + bucket = (var.redirect_bucket_name == null) ? "redirect-${var.source_domain}-to-${var.target_domain}" : var.redirect_bucket_name website { redirect_all_requests_to = "https://${var.target_domain}" From b14b404282e7eb1afd9a7109e02b49e922f478b8 Mon Sep 17 00:00:00 2001 From: kuannie1 Date: Tue, 19 Nov 2024 20:55:00 -0800 Subject: [PATCH 2/2] fix: shorten comment --- aws-cloudfront-domain-redirect/main.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws-cloudfront-domain-redirect/main.tf b/aws-cloudfront-domain-redirect/main.tf index 43250fb6..fb17f0ed 100644 --- a/aws-cloudfront-domain-redirect/main.tf +++ b/aws-cloudfront-domain-redirect/main.tf @@ -5,6 +5,8 @@ locals { service = var.service project = var.project managedBy = "terraform" + source_domain = var.source_domain + target_domain = var.target_domain } } @@ -38,7 +40,7 @@ module "cert" { resource "aws_cloudfront_distribution" "cf" { enabled = true - comment = "Redirect requests from ${var.source_domain} to ${var.target_domain}." + comment = "Redirect requests--check the tags for the source & redirect domains." aliases = [var.source_domain] viewer_certificate {