Search⌘ K

Built-in Dependency Management

Explore how Terraform builds a resource graph to manage dependencies and resource creation order. Understand when to rely on automatic ordering and when to add explicit dependencies using the depends_on argument to ensure your infrastructure deploys correctly.

Resource graph

When Terraform is analyzing a configuration, it creates a resource graph that lists out all the resources in the configuration and their dependencies. This allows Terraform to create the physical resources in the proper order, and when possible, create resources in parallel if they aren’t interdependent. Let’s consider an example configuration where we’ve defined the following resources:

  • Virtual network
...