TERRAFORM-ASSOCIATE-003 practice question 9 of 30
[Interact with Terraform Modules] Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.
Full set: 226 questionsThe statement is false because Terraform's primary mechanism for managing dependencies is implicit. Terraform automatically builds a dependency graph by parsing the configuration and analyzing the references between resources. For example, if a virtual machine resource configuration references the ID of a virtual network, Terraform understands that the virtual machine depends on the virtual network and will create the network first. The dependson meta-argument is an override mechanism used only to create explicit dependencies for cases where a dependency is not visible to Terraform through direct resource references.
The statement "True" is incorrect because it completely ignores Terraform's core feature of implicit dependency resolution. Relying solely on dependson for all dependencies would be cumbersome and is contrary to Terraform's design, which aims to automate as much of the dependency management as possible.
1. HashiCorp Terraform Documentation, "Resource Dependencies": "When one resource refers to another, it creates an implicit dependency. Terraform uses this dependency information to determine the correct order in which to create the different resources... The dependson argument is accepted by any resource or module block and accepts a list of references to other resources or modules in the same calling module. This creates an explicit dependency."
2. HashiCorp Terraform Documentation, "The dependson Meta-Argument": "Use the dependson meta-argument to handle hidden resource or module dependencies that Terraform cannot automatically infer. You only need to explicitly specify a dependency when a resource relies on some other resource's behavior but does not access any of that resource's data in its arguments."
3. HashiCorp Learn, "Manage Resource Dependencies": "Terraform analyzes your configuration to automatically find dependencies between your resources. This creates an implicit ordering for resource creation and destruction... For dependencies that Terraform cannot infer, you can use the dependson meta-argument to create an explicit dependency."
Keep practicing
Take the free TERRAFORM-ASSOCIATE-003 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other TERRAFORM-ASSOCIATE-003 practice questions
- Question 1[Understand Terraform Basics and CLI] If you update the version constraint in your Terraf…
- Question 2[Navigate Terraform State and Backends] Terraform variable names are saved in the state f…
- Question 3[Understand Terraform Basics and CLI] You modified your Terraform configuration and run T…
- Question 4[Understand Terraform Basics and CLI] You must use different Terraform commands depending…
- Question 6[Understand Terraform Basics and CLI] terraform init creates an example main.tf file in t…
- Question 7[Understand Terraform Basics and CLI] terraform validate confirms that your infrastructur…
