-
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
coalescelist behavior with all empty lists changed in v0.12.0 #21370
Comments
I (personally) believe that explicitly adding a list with an empty string to In terraform 0.13, |
The We retained a Terraform-specific implementation in Terraform 0.12.0 so we wouldn't change the behavior of something like I believe (though I can't say for certain) that Terraform 0.11's
My current feeling on this is to leave both of these returning errors now, since the problem I originally anticipated here doesn't seem to have been problematic in practice and we've seen no reports of problems with |
Unfortunately this break some setups of AWS ec2-instance module: terraform-aws-modules/terraform-aws-ec2-instance#104 |
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. |
In prior versions of Terraform,
coalescelist
with all of the arguments being empty lists caused it to return an empty list.In Terraform v0.12.0, that behavior has changed to be an error instead:
While this new behavior makes sense by the direct definition of the function -- it's supposed to return the first non-empty list, and there isn't one to return -- there now isn't a concise way to say "return the first of these that isn't empty or otherwise return an empty list", which comes up from time to time.
This error situation was added to make this situation more obvious since we assumed that such usage would be user error that could otherwise lead to hard-to-debug incorrect behavior. However, there clearly are use-cases for it, so I think we'll need to either restore the old behavior as-is or provide some way to explicitly opt in to the old behavior.
The text was updated successfully, but these errors were encountered: