Courseiva
Use Terraform outside the core workflowhardMultiple ChoiceObjective-mapped

TF-004 Use Terraform outside the core workflow Practice Question

A team uses Terraform with multiple workspaces and wants to automatically trigger a plan when a pull request is opened in their Git repository. They use Terraform Cloud. Which feature enables this?

⚠ Common exam trap

HashiCorp often tests the distinction between VCS-driven and API-driven workflows, where candidates mistakenly think any automated trigger must use the API, but the VCS-driven workflow is the native Git integration that handles PR events without custom API calls.

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

VCS-driven workflow

The VCS-driven workflow in Terraform Cloud automatically triggers a plan when a pull request is opened in a connected Git repository. This is configured by linking a VCS provider (e.g., GitHub, GitLab) to a workspace and enabling speculative plans on pull requests, which allows Terraform Cloud to run a plan without applying changes.

Answer analysis

Option-by-option breakdown

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

  • VCS-driven workflow

    Why this is correct

    A VCS-driven workflow integrates Terraform with a Version Control System like Git, automatically triggering `terraform plan` operations in a remote execution environment (e.g., Terraform Cloud/Enterprise) whenever changes are pushed or a Pull Request (PR) is opened. This approach provides continuous validation of infrastructure changes, allowing teams to review and approve proposed modifications before they are applied, which is essential for managing multiple workspaces collaboratively and maintaining infrastructure consistency.

  • API-driven workflow

    Why it's wrong here

    An API-driven workflow involves interacting with Terraform Cloud/Enterprise programmatically through its REST API, requiring explicit API calls to initiate plans, applies, or manage workspaces. While powerful for custom integrations and scripting specific operations, this method lacks the inherent automation triggered by code changes in a VCS. It does not automatically validate infrastructure changes upon code submission, making it less suitable for a continuous, collaborative development cycle where automatic validation on PRs is desired.

  • CLI-driven workflow

    Why it's wrong here

    A CLI-driven workflow means executing Terraform commands directly from a local machine's command line, even if remote state and operations are configured. While fundamental for initial development and debugging, this approach centralizes execution on individual workstations, making it difficult to enforce consistent environments, manage state remotely, or integrate with automated CI/CD pipelines. For teams with multiple workspaces, relying solely on local CLI runs introduces operational overhead, potential inconsistencies, and a lack of centralized auditability.

  • Registry-driven workflow

    Why it's wrong here

    A Registry-driven workflow primarily refers to leveraging the Terraform Registry (public or private) for sharing and consuming reusable Terraform modules and providers. While crucial for promoting modularity, standardization, and code reuse in infrastructure code, the Registry itself is a repository for code components, not an execution environment or a workflow orchestrator. It does not directly facilitate the automatic execution of Terraform plans or applies based on code changes, which is the core requirement for a team's operational workflow.

About these practice questions

One of 428 original TF-004 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.