plan: Introduce -minimal-refresh flag to only refresh resources that have proposed changes - #38953
Open
austinvalle wants to merge 4 commits into
Open
plan: Introduce -minimal-refresh flag to only refresh resources that have proposed changes#38953austinvalle wants to merge 4 commits into
-minimal-refresh flag to only refresh resources that have proposed changes#38953austinvalle wants to merge 4 commits into
Conversation
austinvalle
commented
Jul 30, 2026
| createBeforeDestroy bool, | ||
| forceReplace bool, | ||
| keyData instances.RepetitionData, | ||
| suppressSideEffects bool, |
Member
Author
There was a problem hiding this comment.
I went with the least impactful change here to try and avoid side effects of calling this plan method multiple times 😅
austinvalle
commented
Jul 30, 2026
| } | ||
|
|
||
| func (*NilHook) PreDiff(id HookResourceIdentity, dk addrs.DeposedKey, priorState, proposedNewState cty.Value, err error) (HookAction, error) { | ||
| func (*NilHook) PreDiff(id HookResourceIdentity, dk addrs.DeposedKey, err error) (HookAction, error) { |
Member
Author
There was a problem hiding this comment.
These state values were unused in the PreDiff + PostDiff hooks and it was putting us in an awkward spot in internal/terraform/node_resource_plan_instance.go where we want to only call PreDiff once but we're not yet sure if the plan we are running will be the plan we use.
Since it wasn't being used, easy option was to remove it 🧹
austinvalle
force-pushed
the
av/targeted-refresh-in-plan
branch
2 times, most recently
from
August 6, 2026 20:50
94e8174 to
3a38cfd
Compare
-refresh-on-change flag to only refresh resources that have proposed changes-minimal-refresh flag to only refresh resources that have proposed changes
austinvalle
commented
Aug 6, 2026
| )) | ||
| } | ||
|
|
||
| // TODO:@austinvalle: This will eventually be added to HCPT / go-tfe and should be removed |
austinvalle
force-pushed
the
av/targeted-refresh-in-plan
branch
from
August 7, 2026 13:51
e678f91 to
fe2d1d1
Compare
jbardin
reviewed
Aug 7, 2026
austinvalle
force-pushed
the
av/targeted-refresh-in-plan
branch
from
August 10, 2026 14:56
f09ddaa to
f351539
Compare
jbardin
approved these changes
Aug 10, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #35290
This PR introduces a new
-minimal-refreshplanning option, which will skip refreshing resources that do not produce a change with the given state + configuration.Notes
Target Release
1.17.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