Skip to content

Commit

Permalink
bugfix website_enabled (#253)
Browse files Browse the repository at this point in the history
* fix website_enabled

* Auto Format

Co-authored-by: cloudpossebot <[email protected]>
  • Loading branch information
Benbentwo and cloudpossebot authored Dec 20, 2022
1 parent 1f112c9 commit b44d7b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ data "aws_iam_policy_document" "combined" {
source_policy_documents = compact(concat(
data.aws_iam_policy_document.s3_origin.*.json,
data.aws_iam_policy_document.s3_website_origin.*.json,
data.aws_iam_policy_document.s3_ssl_only.*.json,
local.website_enabled ? [] : data.aws_iam_policy_document.s3_ssl_only.*.json,
values(data.aws_iam_policy_document.deployment)[*].json
))
}
Expand Down Expand Up @@ -528,7 +528,7 @@ resource "aws_cloudfront_distribution" "default" {
realtime_log_config_arn = var.realtime_log_config_arn

dynamic "lambda_function_association" {
for_each = var.lambda_function_association
for_each = { for k, v in var.lambda_function_association : k => v if ! local.website_enabled }
content {
event_type = lambda_function_association.value.event_type
include_body = lookup(lambda_function_association.value, "include_body", null)
Expand Down

0 comments on commit b44d7b3

Please sign in to comment.