From 734a3368f5993d2f5c7f3913e035bf152fa28b9d Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Sun, 9 Jun 2024 13:06:44 -0400 Subject: [PATCH] fix(s3_website_origin): purge empty strings --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 8e9e1463..6a19d75d 100644 --- a/main.tf +++ b/main.tf @@ -168,7 +168,7 @@ data "aws_iam_policy_document" "s3_website_origin" { principals { type = "AWS" - identifiers = var.block_origin_public_access_enabled ? flatten([aws_cloudfront_origin_access_identity.default[*].iam_arn, [var.cloudfront_origin_access_identity_iam_arn]]) : ["*"] + identifiers = var.block_origin_public_access_enabled ? compact(flatten([aws_cloudfront_origin_access_identity.default[*].iam_arn, [var.cloudfront_origin_access_identity_iam_arn]])) : ["*"] } dynamic "condition" { for_each = local.website_password_enabled ? ["password"] : []