Fix crash when generating config for a resource with complex sensitive attributes #34996
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.
This PR fixes a crash that occurs when generating configuration for a resource with "complex" sensitive attributes. Complex in this case means a list, set, map or object. Basically anything not a primitive type.
This bug was exposed by an earlier fix in which we started properly marking sensitive attributes within the plan, instead of waiting for the plan renderer to handle these directly (#34567). Now that sensitive marks will appear on values returned by the provider the config generation logic crashes as it is not checking for sensitive marks in the correct places.
The linked stack trace indicates this is happening during the
omitUnknowns
function. The fix in this case is to simply remove that function. As of #34525, it is impossible for us to encounter unknowns at this point anyway so the validation is just needless extra work.There is also a problem with the check for "empty strings as null strings" required due to the legacy SDK. We need to unmark the string value before reading it. We don't need to do anything except restore the marks after the value has been changed into a null.
Fixes #34992
Target Release
1.8.1
Draft CHANGELOG entry
BUG FIXES