+ // We need to find a provider configuration address for each resource
+ // either directly represented by a node or referenced by a node in
+ // the graph, and then create graph edges from provider to provider user
+ // so that the providers will get initialized first.
+
+ var diags tfdiags.Diagnostics
+
+ // To start, we'll collect the _requested_ provider addresses for each
+ // node, which we'll then resolve (handling provider inheritence, etc) in
+ // the next step.
+ // Our "requested" map is from graph vertices to string representations of
+ // provider config addresses (for deduping) to requests.
+ type ProviderRequest struct {
+ Addr addrs.AbsProviderConfig
+ Exact bool // If true, inheritence from parent modules is not attempted
+ }
+ requested := map[dag.Vertex]map[string]ProviderRequest{}
+ needConfigured := map[string]addrs.AbsProviderConfig{}