types: Consider Method for Checking Whether Collection Values are Fully Known #597
Labels
enhancement
New feature or request
types
Issues and pull requests about our types abstraction and implementations.
Module version
Use-cases
Configuration validation logic generally needs to skip over any potentially unknown values. The
IsUnknown() bool
method checks whether the value itself is unknown, but in the case of collection types such asList
,Map
,Object
, andSet
there may be underlying attributes/elements which are unknown. For validators such as the terraform-plugin-framework-validatorslistvalidator.UniqueValues()
, it tries to detect duplicate values in the list based on value type equality. If there are unknown values from differing sources, it may unexpectedly trip up the equality checking since there is no differentiation in the type system between unknown values. For example:Proposal
Upstream in terraform-plugin-go, the
tftypes.Value.IsFullyKnown() bool
method provides additional recursive checks about whether the value contains unknown values. This module could provide something similar for all the framework types or at least the collection types. The implementation may need to lean on using the*Valuable
interfaces to handle custom types.The text was updated successfully, but these errors were encountered: