Courseiva
Understand Terraform's purposehardMultiple ChoiceObjective-mapped

TF-004 Understand Terraform's purpose Practice Question

Which Terraform feature helps manage dependencies between resources?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

depends_on

The `depends_on` argument explicitly specifies dependencies, ensuring resources are created or destroyed in the correct order.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • data source

    Why it's wrong here

    A data source in Terraform is used to fetch information about resources or data that are *not* managed by the current Terraform configuration, or to retrieve computed values from managed resources. While a data source's evaluation might implicitly depend on the existence of the external resource it queries, it does not explicitly define or manage the creation or update order of other Terraform-managed resources within the configuration. Its primary role is data retrieval, not dependency orchestration for resource lifecycle.

  • output

    Why it's wrong here

    An output value in Terraform serves to expose specific data from the configuration, such as resource attributes or module results, to the user or to other Terraform configurations. These values are computed and displayed *after* the resources they reference have been successfully created or updated. Outputs are purely for data presentation and do not play any role in defining or enforcing the operational dependencies or execution order among resources during the `terraform apply` lifecycle.

  • depends_on

    Why this is correct

    The `depends_on` meta-argument is Terraform's explicit mechanism for defining a direct dependency between resources that cannot be inferred automatically through attribute references. When Terraform's implicit dependency graph, built by referencing resource attributes, is insufficient to ensure a specific creation, update, or destruction order, `depends_on` forces one resource to be fully created or updated before another resource begins its lifecycle operations. This ensures proper sequencing for complex or non-obvious inter-resource relationships.

  • provisioner

    Why it's wrong here

    A provisioner in Terraform is a block within a resource definition that executes scripts or commands on a local or remote machine *after* the resource itself has been successfully created or updated. Its purpose is to perform post-creation configuration or setup tasks directly related to that specific resource instance, such as installing software or running initial setup scripts. Provisioners do not establish or manage the dependency order between different Terraform resources; they operate *within* the lifecycle of a single resource, not across multiple resources.

About these practice questions

Courseiva writes every TF-004 question from scratch — 428 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.