Courseiva
Read, generate and modify configurationeasyMultiple ChoiceObjective-mapped

TF-004 Read, generate and modify configuration Practice Question

A team wants to use Terraform to provision infrastructure across multiple cloud providers. Which configuration approach best supports this goal?

⚠ Common exam trap

HashiCorp often tests the misconception that Terraform can only manage a single cloud or that a single provider block can be reused across clouds, when in fact multiple provider blocks are required and fully supported for multi-cloud configurations.

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

Define multiple provider blocks, one for each cloud provider.

Terraform uses multiple provider blocks to manage resources from different cloud providers within a single configuration. Each provider block configures a separate provider (e.g., aws, azurerm, google) with its own authentication and region settings, allowing Terraform to provision and manage infrastructure across AWS, Azure, GCP, and others in the same state file and execution plan.

Answer analysis

Option-by-option breakdown

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

  • Define multiple provider blocks, one for each cloud provider.

    Why this is correct

    Terraform configurations can declare multiple `provider` blocks to manage resources across different cloud platforms or services. Each `provider` block specifies the configuration for a particular infrastructure provider, such as `aws`, `azurerm`, or `google`. By defining distinct blocks, Terraform understands which provider to use for creating, updating, or deleting specific resources, enabling a single configuration to orchestrate infrastructure across a multi-cloud environment. This is the standard and intended method for multi-cloud deployments.

  • Use a single provider block that supports multiple clouds.

    Why it's wrong here

    There is no single, monolithic Terraform provider designed to natively support and manage resources across multiple distinct cloud platforms like AWS, Azure, and Google Cloud simultaneously within one block. Each cloud provider has its own unique API, authentication mechanisms, and resource definitions, requiring dedicated provider plugins to interact with them effectively. Terraform's architecture relies on specialized providers for each service, making a universal multi-cloud provider impractical and non-existent.

  • Terraform cannot manage multiple clouds in one configuration.

    Why it's wrong here

    This statement is incorrect because Terraform is fundamentally designed to be cloud-agnostic and supports managing infrastructure across multiple cloud providers within a single configuration. Its extensible provider model allows users to define resources from AWS, Azure, Google Cloud, or any other supported service side-by-side in the same `.tf` files. This capability is a core strength of Terraform, enabling complex hybrid or multi-cloud architectures from a unified codebase.

  • Create separate workspaces for each cloud provider.

    Why it's wrong here

    Terraform workspaces are primarily used to manage multiple distinct states for the *same* configuration, typically for different environments like `dev`, `staging`, or `prod`. They isolate state files but do not inherently separate or configure different cloud providers. To manage multiple cloud providers, the configuration itself must define the respective `provider` blocks, regardless of the workspace in use. Using separate workspaces for each cloud provider would be a misapplication of their intended purpose and would not resolve the need for distinct provider configurations.

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.