Skip to content

Commit

Permalink
add provider metas to destroy plan
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Jun 2, 2022
1 parent 07b1375 commit b9bed3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/terraform/node_resource_abstract_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ func (n *NodeAbstractResourceInstance) planDestroy(ctx EvalContext, currentState
return plan, diags.Append(err)
}

metaConfigVal, metaDiags := n.providerMetas(ctx)
diags = diags.Append(metaDiags)
if diags.HasErrors() {
return plan, diags
}

// Allow the provider to check the destroy plan, and insert any necessary
// private data.
resp := provider.PlanResourceChange(providers.PlanResourceChangeRequest{
Expand All @@ -430,6 +436,7 @@ func (n *NodeAbstractResourceInstance) planDestroy(ctx EvalContext, currentState
PriorState: unmarkedPriorVal,
ProposedNewState: nullVal,
PriorPrivate: currentState.Private,
ProviderMeta: metaConfigVal,
})

// We may not have a config for all destroys, but we want to reference it in
Expand Down

0 comments on commit b9bed3e

Please sign in to comment.