-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
sort does not work properly? #17448
Comments
Hi @radekg! Sorry for the confusing result here. Based on the output here it looks like (We can see that it's a set because the keys are arbitrary large numbers, rather than incrementing indices as would be expected for a list.) AFAIK the underlying Route53 API here also doesn't preserve order, so I think the behavior here is correct, albeit confusing. However, if I'm wrong about that at the Route53 API does respect the ordering here then that suggests an AWS provider bug, in which case we can have our bot move this issue into the AWS provider repository to put it on the radar of the AWS provider maintainers. |
Hey @apparentlymart, that does explain the issue I'm seeing. It's confusing, for sure, but makes sense on a second thought.
The example is modified by hand to reflect a real world output, the high numbers are only examples. However, what I see is that two different changesets within the same plan get these records in different order. Making that consistent should not be computationally heavy. I could take a look at that but, as described, this does not require a fix. Thanks for the explanation. |
Unfortunately the ordering has already been "lost" to type conversion by the time we render the diff, but we have a new diff rendering planned (see #15180) which exploits the more type information available with the new config language interpreter and we may be able to apply a more consistent sort for sets, even though we can't preserve the order originally given in the config. |
Okay, I’ll close this one. 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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The code:
The output in plan:
Clearly this isn't sorted properly.
The order after the sort should be:
Terraform 0.11.3, aws plugin version 1.9.0 and 1.10.0.
The text was updated successfully, but these errors were encountered: