Terraform Ordering Without depends_on

Most engineers assume Terraform executes top to bottom.
It does not.

Terraform builds a dependency graph from references inside expressions. If one resource consumes an attribute from another, Terraform creates an edge. That edge determines sequencing during apply. If no edge exists, Terraform runs resources in parallel.

Parallel execution is not a bug. It is the default behavior.

This becomes a problem when the real system requires ordering, but the graph does not represent it. The result is a race condition that may fail once and succeed on retry. The failure is not random. The dependency was never defined.

In this lesson, we break down:

  • How implicit dependencies are formed
  • Why attribute references create deterministic order
  • When depends_on is necessary
  • Why artificial edges create brittle infrastructure

The goal is not to memorize syntax. The goal is to understand how Terraform schedules work inside the graph.

https://youtu.be/iNRN4r9D0hc