Skip to content

Commit 6a38025

Browse files
authored
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
1 parent 154fb4c commit 6a38025

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

main.tf

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,9 @@ resource "aws_dynamodb_table" "default" {
140140
}
141141
}
142142

143-
dynamic "ttl" {
144-
for_each = var.ttl_enabled ? [1] : []
145-
content {
146-
attribute_name = var.ttl_attribute
147-
enabled = var.ttl_enabled
148-
}
143+
ttl {
144+
enabled = var.ttl_attribute != "" ? var.ttl_enabled : false
145+
attribute_name = var.ttl_attribute
149146
}
150147

151148
tags = var.tags_enabled ? module.this.tags : null

0 commit comments

Comments
 (0)