diff --git a/terraform/graph.go b/terraform/graph.go index 56ef94bc0..61fb94cea 100644 --- a/terraform/graph.go +++ b/terraform/graph.go @@ -284,12 +284,9 @@ func graphAddDiff(g *depgraph.Graph, d *Diff) error { newNode.Resource.Diff = &ResourceDiff{Destroy: true} // Append it to the list so we handle it later - deps := make([]*depgraph.Dependency, len(n.Deps)) - copy(deps, n.Deps) newN := &depgraph.Noun{ Name: fmt.Sprintf("%s (destroy)", newNode.Resource.Id), Meta: newNode, - Deps: deps, } nlist = append(nlist, newN) diff --git a/terraform/graph_test.go b/terraform/graph_test.go index a83b10c47..1b38be511 100644 --- a/terraform/graph_test.go +++ b/terraform/graph_test.go @@ -276,6 +276,7 @@ const testTerraformGraphDiffDestroyStr = ` root: root aws_instance.bar aws_instance.bar -> aws_instance.bar (destroy) + aws_instance.bar -> aws_instance.foo aws_instance.bar (destroy) aws_instance.foo aws_instance.foo -> aws_instance.foo (destroy) diff --git a/terraform/test-fixtures/graph-diff-destroy/main.tf b/terraform/test-fixtures/graph-diff-destroy/main.tf index ca956330c..da9db4e0c 100644 --- a/terraform/test-fixtures/graph-diff-destroy/main.tf +++ b/terraform/test-fixtures/graph-diff-destroy/main.tf @@ -1,2 +1,6 @@ resource "aws_instance" "foo" { } + +resource "aws_instance" "bar" { + foo = "${aws_instance.foo.id}" +}