Courseiva
Interact with Terraform modulesmediumMultiple ChoiceObjective-mapped

TF-004 Interact with Terraform modules Practice Question

A team is using a module from the Terraform Registry. When they run 'terraform init', they receive an error stating that the module source cannot be downloaded. The module source is correct. What is the most likely cause?

⚠ Common exam trap

The trap is that candidates might think the issue is a typo in the source or a version conflict, but in this case the source is correct and the error occurs during init, so network issues are the primary suspect. Do not confuse this with forgetting to run init, as the error message itself indicates that init is being executed.

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

The internet connection is down.

The error 'module source cannot be downloaded' occurs during terraform init when Terraform tries to fetch the module from the registry but cannot reach it. Since the module source is correct, the most likely cause is a network connectivity issue, such as the internet being down. The other options are less likely: A (output variable misspellings) would not prevent downloading; B (provider version conflict) would cause a different error later; D (forgotten init) is illogical because the error occurs while running init.

Answer analysis

Option-by-option breakdown

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

  • The module output variable names are misspelled.

    Why it's wrong here

    Misspellings in module output variable names would only manifest as errors when another part of the configuration attempts to reference those specific outputs. For example, if the root module tries to access `module.my_module.output.incorrect_name`, Terraform would report an unknown output variable during the configuration parsing and validation stages. This type of error occurs during `terraform plan` or `terraform apply`, long after `terraform init` has successfully downloaded and installed the module's source code.

  • The provider version in the module conflicts with the root provider version.

    Why it's wrong here

    Provider version conflicts are detected much later in the Terraform workflow, specifically during the `terraform plan` or `terraform apply` phases. During `terraform init`, Terraform's primary task regarding modules is to download their source code and install required provider plugins. It is only when Terraform attempts to build the dependency graph and validate the configuration against provider requirements that version incompatibilities between the root module and a child module's declared providers would be identified, not during the initial module download.

  • The internet connection is down.

    Why this is correct

    Terraform init is the command responsible for downloading modules from their specified sources, including the public Terraform Registry. If the internet connection is down or unstable, Terraform cannot establish a connection to the registry to fetch the module's source code. This network connectivity issue directly prevents the initialization process from completing successfully, resulting in an error indicating a failure to download the module.

  • The user forgot to run 'terraform init' before 'terraform plan' or 'apply'.

    Why it's wrong here

    The problem statement explicitly indicates that the user is running `terraform init`, as it describes a failure occurring during the module download phase of that command. If the user had genuinely forgotten to run `terraform init` before attempting `terraform plan` or `terraform apply`, those subsequent commands would fail with a distinct error message, typically stating that the working directory has not been initialized or that required providers/modules are not installed. The current error points to an `init` command that is executing but encountering an external obstacle.

About these practice questions

This TF-004 question is part of Courseiva's 428-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.