all: Add UseNonNullStateForUnknown plan modifier to assist with child nested attribute use-cases
#1242
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #1197
Ref #1211, #1161, #1117
Description
This PR introduces a new plan modifier that implements the same logic as pre-1.15.1
UseStateForUnknown, so it will not preservenullstate values, allowing them to stay marked as unknown.The primary use-case for a plan modifier like this is for use on child-attributes in a nested attribute which will only be preserved once the nested object exists (regardless of whether the resource has been created or not). See #1197 (comment) for a detailed description of the rationale.
While this plan modifier solves the problem more broad then needed, it's also the most accessible/understandable solution for nested attributes of requiring this behavior, since detecting if a parent object exists is not an easy operation (see any issue referencing set identity or their planning 😏 ).
As there were existing providers that may be expecting pre 1.15.1 behavior on
UseStateForUnknown, I plan on retroactively updating the 1.15.1 changelog (in this PR) + GH release to reference this behavior change more explicitly.Rollback Plan
Changes to Security Controls
No