Skip to content

Commit

Permalink
feat: adding the option to disable ttl once it was enable before (#111)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alfredo-gil committed Mar 9, 2024
1 parent 154fb4c commit 6a38025
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a38025

Please sign in to comment.