← Lessons/Dependencies & the Resource Graph
← Dependencies & the Resource Graph

Two resources, no relationship

Learn

No edges, no order

The starter declares a network and a server that don't mention each other. The plan creates both:

Plan: 2 to add, 0 to change, 0 to destroy.

But nothing in the configuration connects them, so the graph has two nodes and no edge. Terraform is free to create them in either order, or at the same time: it runs independent work in parallel (up to 10 operations at once by default), which is a big part of why large applies are fast.

The order resources appear in the file means nothing. Moving the server block above the network would plan exactly the same. When order matters, it has to be expressed in the graph, and the next step shows the idiomatic way.

Run plan. Both resources will be created (Plan: 2 to add, 0 to change, 0 to destroy.), but nothing connects them — there's no edge in the graph, so Terraform is free to create them in any order. That's fine here, but most of the time order matters.

Loading...

State Inspector

State

Terraform's memory

empty — nothing here yet

Real Infrastructure

the actual world

empty — nothing here yet