diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 377aae3da..4d4d7b7d9 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -1759,6 +1759,8 @@ func TestContext2Apply_multiVar(t *testing.T) { t.Fatalf("bad: \n%s", actual) } + t.Logf("Initial state: %s", state.String()) + // Apply again, reduce the count to 1 { ctx := testContext2(t, &ContextOpts{ @@ -1782,6 +1784,10 @@ func TestContext2Apply_multiVar(t *testing.T) { } actual := state.RootModule().Outputs["output"] + if actual == nil { + t.Fatal("missing output") + } + expected := "bar0" if actual.Value != expected { t.Fatalf("bad: \n%s", actual) diff --git a/terraform/transform_output.go b/terraform/transform_output.go index 1462f8cea..b260f4caa 100644 --- a/terraform/transform_output.go +++ b/terraform/transform_output.go @@ -1,10 +1,7 @@ package terraform import ( - "log" - "github.com/hashicorp/terraform/config/module" - "github.com/hashicorp/terraform/dag" ) // OutputTransformer is a GraphTransformer that adds all the outputs @@ -42,9 +39,6 @@ func (t *OutputTransformer) transform(g *Graph, m *module.Tree) error { return nil } - // Build the reference map so we can determine if we're referencing things. - refMap := NewReferenceMap(g.Vertices()) - // Add all outputs here for _, o := range os { // Build the node. @@ -57,20 +51,6 @@ func (t *OutputTransformer) transform(g *Graph, m *module.Tree) error { Config: o, } - // If the node references something, then we check to make sure - // that the thing it references is in the graph. If it isn't, then - // we don't add it because we may not be able to compute the output. - // - // If the node references nothing, we always include it since there - // is no other clear time to compute it. - matches, missing := refMap.References(node) - if len(missing) > 0 { - log.Printf( - "[INFO] Not including %q in graph, matches: %v, missing: %s", - dag.VertexName(node), matches, missing) - continue - } - // Add it! g.Add(node) }