Terraform plan changes based on existence of depends_on in module

One specific way that depends_on can affect an outcome is to force a value to be unknown “(known after apply)” rather than to be a concrete known value. That is a consequence of forcing particular read actions to happen during the apply step instead of the plan step, and is by design.

As I mentioned above, depends_on gives Terraform less information about your intent and so it knows less during planning and so it will include more unknown values during the plan, affecting the outcome. The solution is to use more precise declarations of dependencies, ideally involving direct references to particular values. depends_on for modules is particularly tricky, because it effectively creates many additional dependency edges all at once; this is why we resisted adding depends_on for modules for a long time, but eventually added it due to high demand even though it does come with this significant downside.