cloudposse / terraform-aws-dynamodb

Terraform module that implements AWS DynamoDB with support for AutoScaling
https://cloudposse.com/accelerate
Apache License 2.0
86 stars 113 forks source link

ttl_enabled doesn't work on update #94

Closed alexjurkiewicz closed 3 years ago

alexjurkiewicz commented 3 years ago

Describe the Bug

If you deploy this module with ttl_enabled = false, it works. But if you re-run Terraform, the table is marked to be updated with the following diff:

      ~ ttl {
          + attribute_name = "Expires"
            # (1 unchanged attribute hidden)
        }

Which fails:

│ Error: error updating DynamoDB Table (mytable) time to live: error updating DynamoDB Table (mytable) Time To Live: ValidationException: TimeToLive is already disabled
│   status code: 400, request id: 123
│ 
│   with module.dynamodb["mytable"].aws_dynamodb_table.default[0],
│   on .terraform/modules/dynamodb/main.tf line 46, in resource "aws_dynamodb_table" "default":
│   46: resource "aws_dynamodb_table" "default" {

Expected Behavior

No changes on update. Add any other context about the problem here.

github-actions[bot] commented 3 years ago

Thank you for reporting the issue! If you haven't already joined our slack community, then we invite you to do so.

This is a great place to get help and ask questions from our AMAZING community.

Slack Community

mwarkentin commented 3 years ago

For anyone running into this, I found it worked well when I used the following:

ttl_enabled   = false
ttl_attribute = ""

Possible workaround until this fix lands.