TF-004 Use Terraform outside the core workflow Practice Question
An organization uses Terraform Cloud and wants to automate run triggers when a new version of a module is published in a private module registry. What is the recommended method?
⚠ Common exam trap
The trap is that candidates often confuse GitOps workflows (Option A) with Terraform Cloud's native webhook integration. Terraform Cloud uses webhooks from its own module registry (or Terraform Enterprise) to trigger runs when a new module version is published, not from general Git repository events.
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
✓
Configure a webhook in the private module registry to notify Terraform Cloud.
Terraform Cloud supports webhook notifications from private module registries. When a new module version is published, the registry can send an HTTP POST payload to a configured webhook URL in Terraform Cloud, which triggers a run in the associated workspace. This eliminates the need for polling or manual intervention, aligning with Terraform Cloud's event-driven automation model.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a Git repository with versioned modules and use GitOps.
Why it's wrong here
While creating a Git repository with versioned modules and using GitOps is a robust practice for managing infrastructure code, it does not inherently automate the detection and application of *new module versions* published in a registry. An update to a consuming configuration would still require a manual commit to the Git repository, explicitly changing the module version reference, before Terraform Cloud would initiate a plan or apply. This makes it a manual trigger, not an automatic response to module publication.
- ✓
Configure a webhook in the private module registry to notify Terraform Cloud.
Why this is correct
Configuring a webhook in the private module registry allows for real-time, event-driven automation. When a new module version is published, the registry sends an HTTP POST request to a pre-configured endpoint in Terraform Cloud, notifying it of the change. This enables Terraform Cloud to immediately detect the new version and potentially trigger runs in workspaces that consume that module, facilitating seamless, automated updates without manual intervention or polling.
- ✗
Schedule terraform plan to run periodically via cron.
Why it's wrong here
Scheduling `terraform plan` to run periodically via cron is an inefficient and non-reactive approach to automating updates based on new module publications. Cron jobs execute at fixed intervals, meaning they might run unnecessarily when no new module versions exist, or introduce significant latency before detecting a newly published module. This method lacks the event-driven responsiveness required for true automation in this scenario, consuming resources without guaranteed immediate benefit.
- ✗
Use the Terraform Cloud API to poll the registry for new versions.
Why it's wrong here
Using the Terraform Cloud API to continuously poll the private module registry for new versions is an inefficient and resource-intensive method. Frequent polling consumes API rate limits and network bandwidth, even when no updates have occurred, leading to unnecessary overhead and potential delays if rate limits are hit. This approach also introduces latency between the module publication and its detection, making it less optimal than an immediate, event-driven notification system.
Go deeper
Related to this question
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 →
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.