Terraform does not process resources one at a time in file order. It builds a dependency graph: a directed acyclic graph (a graph with directions and no loops) where each node is a resource, data source, provider, variable, output or similar object, and each edge means one node must be handled before another. Edges come from references between blocks, such as a subnet using aws_vpc.main.id, and from explicit depends_on arguments.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 6 more sections, 4 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.