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.
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)- A7% (2)
- C89% (25)
- D4% (1)
Why each option
The depends_on meta-argument creates an explicit dependency, directly declaring that one resource must be fully provisioned before another.
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.
'Internal dependency' is not a recognized Terraform dependency classification.
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.
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
Community Discussion
No community discussion yet for this question.