Terraform execution

826 views Asked by At

Assuming I have multiple *.tf files in a terraform project. When I execute a terraform apply I want to know if:

  1. Terraform will go over all files to build the DAG (Direct Acyclic Graph) and then start provisioning the resources.
  2. Terraform will read file by file and provision the resources and when a dependency was found it will skip the resource and come back after resolving the dependency in question.
1

There are 1 answers

0
Dan W On

According to the documentation, the order of resources is based upon relationships instead of files:

Terraform automatically processes resources in the correct order based on relationships defined between them in configuration, and so you can organize resources into source files in whatever way makes sense for your infrastructure.

You can also use the terraform plan action to see what resources would be created without performing an execution:

This command is a convenient way to check whether the execution plan for a set of changes matches your expectations without making any changes to real resources or to the state.