diff --git a/main.tf b/main.tf index 34d7acd1..94aa0e9c 100644 --- a/main.tf +++ b/main.tf @@ -24,8 +24,11 @@ resource "aws_s3_bucket" "default" { tags = module.this.tags acceleration_status = var.transfer_acceleration_enabled ? "Enabled" : null - versioning { - enabled = var.versioning_enabled + dynamic "versioning" { + for_each = var.versioning_enabled ? [true] : [] + content { + enabled = true + } } dynamic "lifecycle_rule" {