TA-002-P · Question #320
In terraform, most resource dependencies are handled automatically. Which of the following statements describes best how terraform resource dependencies are handled?
The correct answer is D. Terraform analyses any expressions within a resource block to find references to other. Terraform automatically resolves most resource dependencies by analyzing configuration expressions that reference attributes of other resources.
Question
In terraform, most resource dependencies are handled automatically. Which of the following statements describes best how terraform resource dependencies are handled?
Options
- AResource dependencies are identified and maintained in a file called
- BThe terraform binary contains a built-in reference map of all defined Terraform resource
- CResource dependencies are handled automatically by the depends_on meta_argument,
- DTerraform analyses any expressions within a resource block to find references to other
How the community answered
(66 responses)- A2% (1)
- B9% (6)
- C3% (2)
- D86% (57)
Why each option
Terraform automatically resolves most resource dependencies by analyzing configuration expressions that reference attributes of other resources.
Terraform does not store resource dependencies in a dedicated file; it constructs a dependency graph dynamically based on the configuration during planning.
The Terraform binary does not contain a static reference map of all possible resource dependencies; dependencies are determined dynamically from the user's HCL configuration.
The `depends_on` meta-argument is used to declare *explicit* dependencies, not the mechanism for how *most* dependencies are handled *automatically* by Terraform through expression analysis.
Terraform automatically builds a dependency graph by analyzing configuration expressions within resource blocks, identifying when one resource's attribute is referenced by another, thereby establishing an implicit dependency that dictates resource creation order.
Concept tested: Terraform implicit dependencies
Source: https://developer.hashicorp.com/terraform/language/syntax/dependencies
Topics
Community Discussion
No community discussion yet for this question.