Skip to content

Commit

Permalink
use key data from plan method for apply
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Nov 1, 2022
1 parent ffe2e39 commit efd7715
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions internal/terraform/node_resource_apply_instance.go
Expand Up @@ -271,7 +271,7 @@ func (n *NodeApplyableResourceInstance) managedResourceExecute(ctx EvalContext)

// Make a new diff, in case we've learned new values in the state
// during apply which we can now incorporate.
diffApply, _, _, planDiags := n.plan(ctx, diff, state, false, n.forceReplace)
diffApply, _, repeatData, planDiags := n.plan(ctx, diff, state, false, n.forceReplace)
diags = diags.Append(planDiags)
if diags.HasErrors() {
return diags
Expand All @@ -296,12 +296,6 @@ func (n *NodeApplyableResourceInstance) managedResourceExecute(ctx EvalContext)
return diags
}

var repeatData instances.RepetitionData
if n.Config != nil {
forEach, _ := evaluateForEachExpression(n.Config.ForEach, ctx)
repeatData = EvalDataForInstanceKey(n.ResourceInstanceAddr().Resource.Key, forEach)
}

// If there is no change, there was nothing to apply, and we don't need to
// re-write the state, but we do need to re-evaluate postconditions.
if diffApply.Action == plans.NoOp {
Expand Down

0 comments on commit efd7715

Please sign in to comment.