From 45f2a61bdb22c71202baf6eaa6d620fcdbdd1c24 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 3 Dec 2019 13:13:50 -0500 Subject: [PATCH] do not connect references from destroy nodes Destroy nodes only require their own state to evaluate. Do not connect any of their references in the graph. --- terraform/transform_reference.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/terraform/transform_reference.go b/terraform/transform_reference.go index df34a3cea..945479bcf 100644 --- a/terraform/transform_reference.go +++ b/terraform/transform_reference.go @@ -80,6 +80,12 @@ func (t *ReferenceTransformer) Transform(g *Graph) error { // Find the things that reference things and connect them for _, v := range vs { + if _, ok := v.(GraphNodeDestroyer); ok { + // destroy nodes references are not connected, since they can only + // use their own state. + continue + } + parents, _ := m.References(v) parentsDbg := make([]string, len(parents)) for i, v := range parents {