diff --git a/terraform/transform_destroy_edge.go b/terraform/transform_destroy_edge.go index a04b3ae7e..41940d37a 100644 --- a/terraform/transform_destroy_edge.go +++ b/terraform/transform_destroy_edge.go @@ -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{}, }