From f884573a98404992876b8f631a6ca59445d9fe0e Mon Sep 17 00:00:00 2001 From: Ovidiu BOGDAN <3527534+madpipeline@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:54:41 +0300 Subject: [PATCH] Allow for dynamic optional logging --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 97441ed..783eaa3 100644 --- a/main.tf +++ b/main.tf @@ -54,7 +54,7 @@ resource "aws_s3_directory_bucket" "this" { } resource "aws_s3_bucket_logging" "this" { - count = local.create_bucket && length(keys(var.logging)) > 0 && !var.is_directory_bucket ? 1 : 0 + count = local.create_bucket && length(try(keys(var.logging), [])) > 0 && !var.is_directory_bucket ? 1 : 0 region = var.region