Files
opentf/internal/lang/funcs
Martin Atkins c2ea647ff4 funcs: issensitive returns unknown when given an unknown value
Other parts of the language allow deciding the sensitivity of a value based
on results that won't be known until the apply phase, which means that in
practice we cannot predict the final sensitivity of an unknown value.

Previously this function assumed that an unknown value would always be a
placeholder for a final value of the same sensitivity, which is not a valid
assumption in practice and so using the results of this function could
cause downstream value consistency checks to fail.

This does unfortunately create a situation where a new version of OpenTofu
will return an unknown value in a situation that was previously always
known, which could therefore begin causing a plan-time error if the result
is then used to populate something that is required to be known at plan
time. However, the previous behavior caused OpenTofu to produce confusing
errors (blaming a provider for OpenTofu's mistake) during the apply phase,
and so the potential new plan-time errors are arguably better than the
previous behavior.

Any unknown result is refined as definitely not null to shrink the
potential impact: other parts of the language will still be able to assume
that the result of this function is not null even if it's not yet known.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-07-10 08:12:29 -07:00
..
2024-02-08 09:48:59 +00:00
2024-08-29 13:20:33 -04:00
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00
2024-08-29 13:20:33 -04:00
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00