-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deferred actions: don't plan partial resources during refresh and destroy #36310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic makes sense to me! Also, I tested a combination of this patch and #36311, and it was able to fully recover from an errored destroy plan on subsequent replans.
@@ -1186,6 +1186,159 @@ func TestApplyDestroy(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
"destroy-partial-state": { | |||
path: "destroy-corrupted-state", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Did you wanna rename the testdata as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Co-authored-by: Nick Fagerlund <[email protected]>
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. |
When a count or foreach attribute is unknown, deferred actions makes Terraform plan a fake resource that represents any "unknown" resources that might appear once the attribute is known.
This PR skips this step for refresh and destroy plans. In both these cases, there are no potential resources that could appear. We are only interested in resources that we know concretely already exist when destroying and refreshing. If a count or foreach attribute is unknown during a refresh or destroy plan, we can just ignore that part of the configuration and refresh or destroy the resources that are already in state.
Target Release
next alpha
CHANGELOG entry
N/A, deferred actions is still in alpha