From 68b8f7780bd4239c114abf215525f6293902fda0 Mon Sep 17 00:00:00 2001 From: "alexander.miehe" Date: Fri, 22 Dec 2023 16:39:21 +0100 Subject: [PATCH] PLT-0 - Allow to set origin access controls * fix target --- main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index c8c6f25..2ef7f07 100644 --- a/main.tf +++ b/main.tf @@ -39,6 +39,7 @@ locals { } }) : tomap({}) + target_origin_id = var.create_origin_access_control ? "s3_origin_oac" : "s3_origin" } # Workaround for the input variable validation @@ -96,7 +97,7 @@ module "cloudfront" { origin = merge(local.origin_oai, local.origin_oac) default_cache_behavior = { - target_origin_id = "s3_origin" + target_origin_id = local.target_origin_id viewer_protocol_policy = "redirect-to-https" allowed_methods = ["GET", "HEAD", "OPTIONS"]