diff --git a/internal/terraform/graph_builder_plan.go b/internal/terraform/graph_builder_plan.go index ffa88207cd..fa6caaf049 100644 --- a/internal/terraform/graph_builder_plan.go +++ b/internal/terraform/graph_builder_plan.go @@ -191,7 +191,9 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer { // DestroyEdgeTransformer is only required during a plan so that the // TargetsTransformer can determine which nodes to keep in the graph. - &DestroyEdgeTransformer{}, + &DestroyEdgeTransformer{ + Operation: b.Operation, + }, &pruneUnusedNodesTransformer{ skip: b.Operation != walkPlanDestroy, diff --git a/internal/terraform/transform_destroy_edge.go b/internal/terraform/transform_destroy_edge.go index 3f87e7edf3..2d6fb7083f 100644 --- a/internal/terraform/transform_destroy_edge.go +++ b/internal/terraform/transform_destroy_edge.go @@ -88,7 +88,7 @@ func (t *DestroyEdgeTransformer) tryInterProviderDestroyEdge(g *Graph, from, to // If this is a complete destroy operation, then there are no create/update // nodes to worry about and we can accept the edge without deeper inspection. - if t.Operation == walkDestroy { + if t.Operation == walkDestroy || t.Operation == walkPlanDestroy { return }