-
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
aws_dynamodb_table - with ttl disabled, can't "terraform apply" twice #10304
Comments
Just to give more context here and to #3463 I just found out talking with AWS that the DynamoDB TTL API is batched, meaning that there is no way without to set atomically It is normal for DynamoDB API to reply with an error when trying to disable an already-disabeld TTL; and it's normal to not be able to enable/disable in a short period of time, you would get this error form CLI
This is a PITA for Terraform because it means that when operating through the DynamoDB TTL settings we should have a polling or a time-bound control that we can actually perform an atomic operation. |
As per this doc page
so we can't really have this state reconciliation loop in Terraform... |
The "ValidationException: TimeToLive is already disabled" error is quite annoying if you are trying to modularize this. credit: https://www.reddit.com/r/Terraform/comments/d1va2o/terrfaorm_support_null_block/
|
Curious, was there an actual fix to this? |
Hey y'all 👋 Thank you for taking the time to file this issue and for the continued discussion! Given that there's been a number of AWS provider releases since it was initially filed, can anyone confirm whether you're still experiencing this behavior? |
Still happening. |
Perhaps the documentation should be updated so that this isn't the default example. |
The issue is still happening. |
Still happening here ✋ |
Still happening with provider version |
still happening in 4.9.0 |
^ +1 |
Still happening.. |
still happening |
2 similar comments
still happening |
still happening |
Still happening |
1 similar comment
Still happening |
I am still getting this error. And the only workaround seems to be the one suggested by @MattMcKeithen of using dynamic block. (not tried it yet) |
Sadly a dynamic block doesn't work,
If you enable ttl it work, but then if you disable it, the block disappear and terraform doesn't see you want a enabled=false and it doesn't report any change and AWS keep the ttl settings. I see that as a bug.
|
Still happening |
1 similar comment
Still happening |
Still happening |
still happening |
This isn't really a "fix" but here is what I did to get it to not error (you probably only need step 3 but this is how I got there):
Sorry if someone already said this above but seems like the issue comes from "disabled" ttl not needing or using the supplied attribute name, but the resource definition requires an attribute name and many people probably just copy the example which gives one. So when you try to apply an update, it sees a "new" attribute definition it didn't use the first time. The documentation example should really be fixed to reflect this and the documentation should explain this quirk. |
@kennethjmyers I have tried setting
Looking at the plan, it seems like terraform is taking a blank string in the table config and turning that into null:
I'm using the typescript CDK Steps to reproduce:
In order to actually disable the TTL and have terraform stop trying to re-add attribute_name as in the OP of this issue, I need to follow these steps:
|
This problem has existed for years on this thread alone and this is the new issue for this problem. This is just one of dozens of open bugs annoying my team with terraform at this juncture. |
Still happening, Curious, was there an actual fix to this? opened - Sep 30, 2019 - Now( Dec 26, 2023 ). |
Still happening , sadly. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.55.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. 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. |
This issue was originally opened by @nunoperalta as hashicorp/terraform#22942. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Expected Behavior
When doing "terraform apply" twice, there should be no changes to make.
Actual Behavior
First "terraform apply" will create the DynamoDB table.
However, second time, there will be a change at:
If I confirm the change, I get this crash:
If I remove the "attribute_name", I get this error:
The text was updated successfully, but these errors were encountered: