@@ -1562,7 +1562,7 @@ func (n *NodeAbstractResourceInstance) providerMetas(ctx EvalContext) (cty.Value
15621562// value, but it still matches the previous state, then we can record a NoNop
15631563// change. If the states don't match then we record a Read change so that the
15641564// new value is applied to the state.
1565- func (n * NodeAbstractResourceInstance ) planDataSource (ctx EvalContext , checkRuleSeverity tfdiags.Severity ) (* plans.ResourceInstanceChange , * states.ResourceInstanceObject , instances.RepetitionData , tfdiags.Diagnostics ) {
1565+ func (n * NodeAbstractResourceInstance ) planDataSource (ctx EvalContext , checkRuleSeverity tfdiags.Severity , skipPlanChanges bool ) (* plans.ResourceInstanceChange , * states.ResourceInstanceObject , instances.RepetitionData , tfdiags.Diagnostics ) {
15661566 var diags tfdiags.Diagnostics
15671567 var keyData instances.RepetitionData
15681568 var configVal cty.Value
@@ -1616,6 +1616,17 @@ func (n *NodeAbstractResourceInstance) planDataSource(ctx EvalContext, checkRule
16161616 // producing a "Read" change for this resource, and a placeholder value for
16171617 // it in the state.
16181618 if depsPending || ! configKnown {
1619+ // We can't plan any changes if we're only refreshing, so the only
1620+ // value we can set here is whatever was in state previously.
1621+ if skipPlanChanges {
1622+ plannedNewState := & states.ResourceInstanceObject {
1623+ Value : priorVal ,
1624+ Status : states .ObjectReady ,
1625+ }
1626+
1627+ return nil , plannedNewState , keyData , diags
1628+ }
1629+
16191630 var reason plans.ResourceInstanceChangeActionReason
16201631 switch {
16211632 case ! configKnown :
0 commit comments