Skip to content

Commit b44d7b3

Browse files
bugfix website_enabled (#253)
* fix website_enabled * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent 1f112c9 commit b44d7b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ data "aws_iam_policy_document" "combined" {
235235
source_policy_documents = compact(concat(
236236
data.aws_iam_policy_document.s3_origin.*.json,
237237
data.aws_iam_policy_document.s3_website_origin.*.json,
238-
data.aws_iam_policy_document.s3_ssl_only.*.json,
238+
local.website_enabled ? [] : data.aws_iam_policy_document.s3_ssl_only.*.json,
239239
values(data.aws_iam_policy_document.deployment)[*].json
240240
))
241241
}
@@ -528,7 +528,7 @@ resource "aws_cloudfront_distribution" "default" {
528528
realtime_log_config_arn = var.realtime_log_config_arn
529529

530530
dynamic "lambda_function_association" {
531-
for_each = var.lambda_function_association
531+
for_each = { for k, v in var.lambda_function_association : k => v if ! local.website_enabled }
532532
content {
533533
event_type = lambda_function_association.value.event_type
534534
include_body = lookup(lambda_function_association.value, "include_body", null)

0 commit comments

Comments
 (0)