Terraform builds a dependency graph from expression references. When a service reads a network attribute, the reference records the relationship as well as passing the value. Prefer this direct connection when a real data dependency exists. depends_on is available for dependencies that cannot be expressed through an attribute, such as a separate permission required before an operation can work.
Extra explicit dependencies can delay work and make more values unknown during planning. In these tasks, connect the service’s network to its managed network resource. A matching literal may work today but can disconnect the relationship when the network name changes.
An attribute reference passes the value and records its dependency.