The PathMatcher used when rendering diffs assumes the caller knows the
structure the path was derived from, which is incorrect.
RelevantAttributes is derived from references to an object, which may
have errors hidden by `try` or `can` functions, or the data may not have
been updated to match paths via targeted operations.
Even in the case where the data may be incorrect, we can't crash when
rendering the data, because the user may not be able to work around the
panic with no other information about which resource contains unexpected
references.
Changes between empty strings and `null` were hidden in the CLI output,
because the SDK could not reliably detect the difference and may return
either value depending on the situation.
This legacy behavior can be confusing for authors of new provider which
can correctly handle `null`, and it would be preferable to be able to
render those changes in the CLI.
While we don't have enough information to detect when the legacy
behavior is required, we can detect a number of cases where it's
certain that we are not dealing with a legacy schema and should output
the full diff.
* jsonplan: document forget actions
* jsonformat: format forget changes as no-op
Previous to this commit, forget-only actions (i.e. "forget", not "create then forget") would be rendered using the forget action symbol for the top-level resource, and the delete action symbol for each resource attribute, with a new value of "null". This attribute rendering is identical to that for resource deletion, which might suggest to some users that Terraform plans to delete the resource, not just remove it from state.
This commit tweaks the renderer so forget-only changes render as no-ops but with the forget action symbol and resource change comment.