failing resource instance apply should keep prior state#37981
Merged
DanielMSchmidt merged 3 commits intomainfrom Dec 11, 2025
Merged
failing resource instance apply should keep prior state#37981DanielMSchmidt merged 3 commits intomainfrom
DanielMSchmidt merged 3 commits intomainfrom
Conversation
3 tasks
nfagerlund
previously approved these changes
Dec 9, 2025
Member
nfagerlund
left a comment
There was a problem hiding this comment.
I manually tested this with my live repro of the bug, using a Terraform build with this patch applied but without the locals fix from #37980. We're good!
- As expected, the plan showed "known after apply" for attrs but didn't error, and allowed me to proceed to apply. (#37980 fixes that.)
- As expected, the apply errored and failed with
aws_amplify_app.default still contains unknown values during apply (this is a bug in Terraform; please report it!). - As hoped for, a subsequent plan and apply with the configuration repaired produced no changes! The errored resource was not removed from state.
dsa0x
previously approved these changes
Dec 10, 2025
jbardin
reviewed
Dec 10, 2025
7df49b1
1959981 to
7df49b1
Compare
7df49b1 to
9dfd55c
Compare
dsa0x
approved these changes
Dec 11, 2025
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 is a code path that can not be taken in normal Terraform, but when TF is used through the RPC API we can end up in these situation, so we should make sure Terraform does not remove the state when an apply fails.
Fixes #
Target Release
1.15.x
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