From 6947cac37cdf809192f803d02cb87bce87dee35d Mon Sep 17 00:00:00 2001 From: nnsense Date: Fri, 12 Nov 2021 19:55:15 +0000 Subject: [PATCH] Dynamic block for versioning added (#118) * Dynamic block for versioning added * Auto Format Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> --- main.tf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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" {