nerdexam
HashiCorp

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.

Read, generate, and modify configuration

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)
  • A
    2% (1)
  • B
    9% (6)
  • C
    3% (2)
  • D
    86% (57)

Why each option

Terraform automatically resolves most resource dependencies by analyzing configuration expressions that reference attributes of other resources.

AResource dependencies are identified and maintained in a file called

Terraform does not store resource dependencies in a dedicated file; it constructs a dependency graph dynamically based on the configuration during planning.

BThe terraform binary contains a built-in reference map of all defined Terraform resource

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.

CResource dependencies are handled automatically by the depends_on meta_argument,

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.

DTerraform analyses any expressions within a resource block to find references to otherCorrect

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

#Resource dependencies#Dependency resolution#Implicit dependencies#Terraform configuration

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice