code: func ConfigTreeDependencies(root *configs.Config, state *states.State) *moduledeps.Module {
  	// First we walk the configuration tree to build the overall structure
  	// and capture the explicit/implicit/inherited provider dependencies.
  	deps := configTreeConfigDependencies(root, nil)
  
  	// Next we walk over the resources in the state to catch any additional
  	// dependencies created by existing resources that are no longer in config.
  	// Most things we find in state will already be present in 'deps', but
  	// we're interested in the rare thing that isn't.
  	configTreeMergeStateDependencies(deps, state)
  
  	return deps
  }
docs: // ConfigTreeDependencies returns the dependencies of the tree of modules
  // described by the given configuration and state.
  //
  // Both configuration and state are required because there can be resources
  // implied by instances in the state that no longer exist in config.