Closed kishorviswanathan closed 5 years ago
Thanks for reporting this, @kishorv06!
The issue here seems to be that the function is not accommodating the requirement from the type system implementation that Terraform uses where an empty map must be constructed using a different function (cty.MapValEmpty
) so that the caller can provide the element type for the map, which would otherwise be inferred automatically from the element values.
So the likely fix here is to check before calling cty.MapVal
whether the map is empty, and call cty.MapValEmpty
with a suitable element type instead.
please check my pr #23321
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.
Terraform Version
Crash Output
Expected Behavior
The function should be returning an empty map if the given map was empty or all its values are empty.
Actual Behavior
The function panics instead of returning an empty map
Steps to Reproduce