mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
This adds a new method to ResourceDiff: Computed, which exposes the computed read result field to ResourceDiff. In the context of customizing the diff, this is important as interpolated and otherwise computed values will show up in the diff as blank, with no way of determining if the value is actually blank or if it's a computed value not available at diff customization time. Currently assumptions need to be made on this, but this does not help in validation scenarios where one needs to differentiate between an actual blank value and a value that will be available later. This is exposed for the most part via NewComputed in the diff, but the tests cover both the config reader as well (with no diff, even though this should not come up in normal operation) and also the newDiff reader when someone sets a new value using SetNew and SetNewComputed. This commit also exposes GetOkExists. The tests were mostly pulled from ResourceData but a few were added to ensure that config was being properly covered as well, in addition to covering SetNew and SetNewComputed. |
||
---|---|---|
.. | ||
acctest | ||
config | ||
copy | ||
customdiff | ||
didyoumean | ||
diff | ||
encryption | ||
experiment | ||
hashcode | ||
hilmapstructure | ||
logging | ||
mutexkv | ||
pathorcontents | ||
resource | ||
schema | ||
shadow | ||
signalwrapper | ||
slowmessage | ||
structure | ||
validation | ||
variables | ||
wrappedreadline | ||
wrappedstreams | ||
README.md |
Helper Libraries
This folder contains helper libraries for Terraform plugins. A running joke is that this is "Terraform standard library" for plugins. The goal of the packages in this directory are to provide high-level helpers to make it easier to implement the various aspects of writing a plugin for Terraform.