Courseiva
Use Terraform outside the core workflowhardMultiple ChoiceObjective-mapped

TF-004 Use Terraform outside the core workflow Practice Question

A Terraform configuration uses a module from the public registry. After a provider update, the module's resources fail to create. What is the most probable cause?

⚠ Common exam trap

HashiCorp often tests the misconception that provider updates are always backward-compatible, leading candidates to incorrectly suspect state corruption or backend misconfiguration instead of module-provider version incompatibility.

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 module is incompatible with the new provider version

C is correct because modules from the public registry often declare a `required_providers` block with version constraints. When the provider is updated outside those constraints (e.g., from v3.x to v4.x), the module may rely on deprecated attributes or changed resource schemas, causing resource creation to fail. Terraform will not automatically adjust module code to match provider API 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.

  • The provider binary is corrupted

    Why it's wrong here

    A corrupted provider binary would typically manifest as immediate, low-level errors during `terraform init` or any operation attempting to interact with the provider, such as "exec format error" or segmentation faults. These issues would prevent *any* resource management by that provider, not selectively fail only when a module attempts to create resources. Therefore, it's highly improbable that corruption would specifically target a module's resource creation while other provider operations remain functional.

  • The state file is corrupted

    Why it's wrong here

    State file corruption would typically lead to errors during state reading, planning, or applying, often manifesting as "malformed state" or "resource not found in state" errors across various resources. Such corruption would affect the entire configuration's ability to track and manage infrastructure, not just the creation of new resources within a specific module. A module's inability to create new resources points to an issue with the configuration or provider interaction, not the integrity of the existing state.

  • The module is incompatible with the new provider version

    Why this is correct

    When a Terraform configuration uses a module that was developed against an older provider version, upgrading the provider can introduce breaking changes. The module's internal resources might rely on arguments, attributes, or behaviors that have been deprecated, removed, or altered in the newer provider version. This incompatibility would specifically manifest as errors during resource creation or update within that module, as the provider no longer understands or supports the module's requested configuration.

  • The backend configuration is incorrect

    Why it's wrong here

    An incorrect backend configuration, such as misconfigured credentials, an unreachable storage location, or an invalid S3 bucket name, would prevent Terraform from loading or saving the state file entirely. This would block all `terraform plan` and `terraform apply` operations, affecting the entire configuration and all resources, not just the creation of resources within a particular module. The error message would typically indicate a failure to initialize or access the backend.

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.