nerdexam
HashiCorp

TA-002-P · Question #294

In the example below, the depends_on argument creates what type of dependency?

The correct answer is C. explicit dependency. The depends_on meta-argument creates an explicit dependency, directly declaring that one resource must be fully provisioned before another.

Read, generate, and modify configuration

Question

In the example below, the depends_on argument creates what type of dependency?

Options

  • Aimplicit dependency
  • Binternal dependency
  • Cexplicit dependency
  • Dnon-dependency resource

How the community answered

(28 responses)
  • A
    7% (2)
  • C
    89% (25)
  • D
    4% (1)

Why each option

The depends_on meta-argument creates an explicit dependency, directly declaring that one resource must be fully provisioned before another.

Aimplicit dependency

An implicit dependency is automatically inferred by Terraform when one resource references an attribute of another; depends_on is the mechanism specifically for cases where no such reference exists.

Binternal dependency

'Internal dependency' is not a recognized Terraform dependency classification.

Cexplicit dependencyCorrect

An explicit dependency is one declared directly in configuration using the depends_on meta-argument, as opposed to implicit dependencies which Terraform infers automatically from resource attribute references. Using depends_on instructs Terraform to enforce a provisioning order even when no direct attribute reference exists between the two resources.

Dnon-dependency resource

depends_on defines a real and enforced ordering dependency between resources, not the absence of a dependency.

Concept tested: Terraform explicit dependency using depends_on meta-argument

Source: https://developer.hashicorp.com/terraform/language/meta-arguments/depends_on

Topics

#explicit dependencies#depends_on argument#resource dependencies

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice