core: In TransformDestroyEdge, insert variable nodes before providers

The provider transforms now depend on analyzing references in order to
properly create provider edges, and so we need to now insert all of the
nodes that can have references and attach schemas before we run
TransformProviders.

This was done for the main graph builders in a previous commit, but as
usual we missed this surprising hidden graph builder that lives inside
a graph transformer. 🙄
This commit is contained in:
Martin Atkins 2018-05-29 16:18:33 -07:00
parent bcadbb2ddb
commit 68c8d83620
1 changed files with 2 additions and 2 deletions

View File

@ -133,8 +133,6 @@ func (t *DestroyEdgeTransformer) Transform(g *Graph) error {
&AttachResourceConfigTransformer{Config: t.Config},
&AttachStateTransformer{State: t.State},
TransformProviders(nil, providerFn, t.Config),
// Add all the variables. We can depend on resources through
// variables due to module parameters, and we need to properly
// determine that.
@ -145,6 +143,8 @@ func (t *DestroyEdgeTransformer) Transform(g *Graph) error {
// extract references from config.
&AttachSchemaTransformer{Components: t.Components},
TransformProviders(nil, providerFn, t.Config),
&ReferenceTransformer{},
}