-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tfstate file is showing wrong state when disabling ttl in DynamoDB #15154
Comments
I found another scenario. Steps:
Expected:On second step when it fails with ValidationException we expect tfstate to have original ttl value that is enabled Actual:it fails but tfstate is changed and ttl enabled = false.
terraform show output on step 3.
Note: Validation exception is expected behaviour from AWS since it takes 1 hour for ttl to reflect. Since table was created with ttl=enabled, it is still under process and turning it to false within an hour throws validation exception. |
see #13923, it may address the issue here |
@DeFaust92 I looked at that issue. As per suggestion, I tried this without attribute name and I still have the issue. when I run terraform apply to disable ttl, it fails with ValidationException but local state file shows ttl is disabled but actually it is not. |
@jbigtani I would try running a ~ enabled = true -> false Were you able to update the resource if the ttl {
attribute_name = "TimeToExist"
enabled = false
} after waiting for an hour or so after the previous modification as it seems using the empty string |
Related to incorrect |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.12.29
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
DynamdoDB ttl should have been disabled.
Actual Behavior
TTL is not disabled on the table.
local tfstate gets updated showing ttl disabled.
When you run config with ttl enabled=true, it says no change is required but tfstate still shows ttl disabled .
Steps to Reproduce
terraform apply
with ttl enabled.ttl {
attribute_name = "TimeToExist"
enabled = true
}
terraform plan
without ttl block.~ ttl {
- attribute_name = "TimeToExist" -> null
~ enabled = true -> false
}
terraform apply
without ttl block.Error: error updating DynamoDB Table (jb-example) time to live: error updating DynamoDB Table (jb-example) Time To Live: InvalidParameter: 1 validation error(s) found.
terraform show. ttl is still enabled on the table because of error in last command.
ttl {
enabled = false
}
terraform plan
with original ttl block with enabled=true.No changes. Infrastructure is up-to-date.
terraform show still shows enabled=false
ttl {
enabled = false
}
The text was updated successfully, but these errors were encountered: