From 6a38025adf5473957923935aac4973b220ada3e0 Mon Sep 17 00:00:00 2001 From: alfredo-gil <85618455+alfredo-gil@users.noreply.github.com> Date: Sat, 9 Mar 2024 05:22:41 +0100 Subject: [PATCH] feat: adding the option to disable ttl once it was enable before (#111) * feat: adding the option to disable ttl once it was enable before * fix: add correct condition * fix: fix condition * fix typo * feat: add terraform fmt --- main.tf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index d57d5d7..7fcabe4 100644 --- a/main.tf +++ b/main.tf @@ -140,12 +140,9 @@ resource "aws_dynamodb_table" "default" { } } - dynamic "ttl" { - for_each = var.ttl_enabled ? [1] : [] - content { - attribute_name = var.ttl_attribute - enabled = var.ttl_enabled - } + ttl { + enabled = var.ttl_attribute != "" ? var.ttl_enabled : false + attribute_name = var.ttl_attribute } tags = var.tags_enabled ? module.this.tags : null