A root module declares depends_on = [module.network] on a module that contains several data sources. Since then, plans show many of that module's data source results as known after apply and propose more changes than expected. What is the recommended fix?
Select an answer to reveal the explanation.
Short Explanation
Module-level depends_on is like telling a whole team to wait for another whole team: everyone stalls, even folks who only needed one answer. When you pass the specific outputs instead, Terraform waits only where it truly must. The trap is moving the same broad dependency somewhere else.
Full Explanation
When depends_on names an entire module, Terraform orders all resources and data sources in the dependent module after everything in the dependency. The documentation recommends depends_on only as a last resort because it makes plans more conservative: Terraform cannot tell which upstream changes matter, so it may treat more values as unknown and defer data source reads to apply time, which in turn can make it plan updates or replacements that are not needed. This is especially likely with depends_on on modules. The recommended alternative is expression references: passing the specific network outputs into module inputs creates implicit dependencies only where values actually flow, so data sources that do not depend on pending changes can be read during planning. Moving the same whole-module dependency onto each data source keeps the dependency just as broad and still defers those reads. Disabling refresh does not resolve dependency-driven unknowns and causes Terraform to ignore external changes, which risks incorrect plans. ignore_changes suppresses updates to named attributes and would hide legitimate changes while leaving the deferred reads in place. Exam caveat: depends_on remains appropriate for hidden dependencies that no expression can express. Operational check: replace the module-level depends_on with output references, run a plan, and confirm the data sources resolve during planning and the extra changes disappear.