b99c615ee6
This adds a new object, ResourceDiff, to the schema package. This object, in conjunction with a function defined in CustomizeDiff in the resource schema, allows for the in-flight customization of a Terraform diff. This helps support use cases such as when there are necessary changes to a resource that cannot be detected in config, such as via computed fields (most of the utility in this object works on computed fields only). It also allows for a wholesale wipe of the diff to allow for diff logic completely offloaded to an external API, if it is a better use case for a specific provider. As part of this work, many internal diff functions have been moved to use a special resourceDiffer interface, to allow for shared functionality between ResourceDiff and ResourceData. This may be extended to the DiffSuppressFunc as well which would restrict use of ResourceData in DiffSuppressFunc to generally read-only fields. This work is not yet in its final state - CustomizeDiff is not yet implemented in the general diff workflow, new functions may be added (notably Clear() for a single key), and functionality may be altered. Tests will follow as well. |
||
---|---|---|
.. | ||
acctest | ||
config | ||
copy | ||
didyoumean | ||
diff | ||
encryption | ||
experiment | ||
hashcode | ||
hilmapstructure | ||
logging | ||
mutexkv | ||
pathorcontents | ||
resource | ||
schema | ||
shadow | ||
signalwrapper | ||
slowmessage | ||
structure | ||
validation | ||
variables | ||
wrappedreadline | ||
wrappedstreams | ||
README.md |
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.