-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
DynamoDB Non-Key Attributes Ordering #3807
Comments
Hey @bacoboy It worked! You have saved us! Thanks man, really appreciate it! |
Is this infernal reordering in the terraform state something that is just naturally fixed in terraform 0.12+ ? |
ordering the non-key_attribute works fine only if they are less than eleven, otherwise you will have always: |
Is there any update on this? |
I believe this is a duplicate of #3828 , and seems to have to do with ordering of non Key Attributes. |
Hi folks 👋 The |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
I believe this is a bug of some kind due to the refactoring in #3136 or maybe it was part of the create logic and has been there all along.
When specifying multiple non-key attributes the order specified in terraform isn't how the table is created and an immediate
terraform plan
shows changes are needed.Start with this table resource:
As you can see,
foo
,bar
andbaz
are the non key attributes. Now runterraform apply
.After the table is created run terraform plan. I expected to see no changes, but got this instead:
Using the aws cli, I confirm the order AWS has them:
The order has changed from
foo
,bar
,baz
(see the order in the create-table operation) TObar
,baz
,foo
(the actual state in AWS and the terraform state)Running
terraform apply
again will drop and recreated theBBB
GSI, but then you are still in the same place:The only way to fix this is to modify the terraform to match whatever ordering was picked the first time:
Now the
terraform plan
shows no changes:Af first I thought the list might need to alphabetical, but my real table needed this modification to align:
The text was updated successfully, but these errors were encountered: