Title: Terraform depends_on Explained | Timing vs Data Flow

Terraform does not run configuration files from top to bottom. It builds a dependency graph from references. Execution order emerges from that graph.

The depends_on meta-argument does not move data. It does not validate logic. It inserts an explicit ordering edge when a real dependency cannot be expressed through a reference.

This distinction matters when external systems treat timing as meaning. A “ready” flag stored in SSM can trigger another pipeline even if the underlying infrastructure is not finished. Without an explicit edge, Terraform may run resources in parallel.

This lesson focuses on:

  • Implicit dependencies created through references
  • Why file order is irrelevant
  • When side effects require explicit ordering
  • How data source reads can occur too early
  • Why overusing depends_on reduces graph parallelism

The core model is simple: references encode identity and order. depends_on encodes timing only.

https://youtu.be/CnZg2kT3Bqw