diff --git a/terraform/graph.go b/terraform/graph.go index 002b7ae9ce..4380ce7515 100644 --- a/terraform/graph.go +++ b/terraform/graph.go @@ -400,6 +400,11 @@ func graphAddProviderConfigs(g *depgraph.Graph, c *config.Config) { func graphAddRoot(g *depgraph.Graph) { root := &depgraph.Noun{Name: GraphRootNode} for _, n := range g.Nouns { + // The root only needs to depend on all the resources + if _, ok := n.Meta.(*GraphNodeResource); !ok { + continue + } + root.Deps = append(root.Deps, &depgraph.Dependency{ Name: n.Name, Source: root, diff --git a/terraform/graph_test.go b/terraform/graph_test.go index cb38bcd65b..4e2b89e2e8 100644 --- a/terraform/graph_test.go +++ b/terraform/graph_test.go @@ -224,7 +224,6 @@ root root -> aws_load_balancer.weblb root -> aws_security_group.firewall root -> openstack_floating_ip.random - root -> provider.aws ` const testTerraformGraphDiffStr = ` @@ -269,5 +268,4 @@ root root -> aws_load_balancer.weblb root -> aws_security_group.firewall root -> openstack_floating_ip.random - root -> provider.aws `