Fix resource identity being dropped from state in certain cases#37396
Merged
Fix resource identity being dropped from state in certain cases#37396
Conversation
131b5a3 to
242a95f
Compare
jbardin
approved these changes
Aug 4, 2025
dbanck
added a commit
that referenced
this pull request
Aug 5, 2025
* Test case for keeping identity on destroy error * Add identity to resource instance object on error * Add changelog * Test case for keeping identity on update without changes * Add identity to resource instance object on udpate
3 tasks
dbanck
added a commit
that referenced
this pull request
Aug 5, 2025
…) (#37402) * Test case for keeping identity on destroy error * Add identity to resource instance object on error * Add changelog * Test case for keeping identity on update without changes * Add identity to resource instance object on udpate
Contributor
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 resolves two issues where Terraform was incorrectly removing resource identity information from the state during apply.
When an error occurs during an destroy operation and the provider returns a new non-null value for the state, the resource identity from the provider response wasn't included in the new state.
When the state values don't change during an update operation, but the marks (e.g. sensitive) do. In this case, Terraform doesn't communicate with the provider and simply updates the state. The resource identity information was also missing in that case.
Target Release
1.13.0
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry