Question 332 of 519
Understand Terraform basicshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to create separate Terraform configurations for each region, each with its own backend configuration and variable files, and use directory structure to enforce separation. This approach is correct because it establishes strict multi-region terraform deployment isolation at the filesystem and state level, preventing a single `terraform.tfvars` file from accidentally overriding variables across workspaces. By decoupling each region’s configuration into its own directory with a dedicated backend, you eliminate the risk of cross-region variable injection that caused the ALB target group misconfiguration. On the HashiCorp Terraform Associate TF-003 exam, this scenario tests your understanding of workspace versus directory-level isolation—a common trap is assuming workspaces alone provide sufficient separation, but they share variable files unless explicitly scoped. Remember the memory tip: “One region, one directory, one state” to enforce clear boundaries and avoid accidental cross-region drift.

TF-003 Understand Terraform basics Practice Question

This TF-003 practice question tests your understanding of understand terraform basics. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You are a platform engineer at a fintech company. Your team manages a multi-region application on AWS using Terraform. The infrastructure includes VPCs, subnets, EC2 instances, and an Application Load Balancer (ALB). The configuration uses modules from the Terraform Registry and remote state in S3 with DynamoDB locking.

Recently, after a colleague ran `terraform apply` in the us-east-1 region, the application experienced downtime because the ALB's target group was accidentally updated to point to instances in us-west-2 instead of us-east-1. The root cause was that the Terraform configuration for the ALB used a variable `target_region` which was hardcoded to us-west-2 in a `terraform.tfvars` file that was not intended for that workspace.

Your team wants to prevent such misconfigurations in the future. Which course of action would most effectively reduce the risk of using incorrect variable values across workspaces?

Question 1hardmultiple choice
Review the full subnetting walkthrough →

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

Create separate Terraform configurations for each region, each with its own backend configuration and variable files, and use directory structure to enforce separation

Option D is correct because creating separate Terraform configurations for each region enforces strict isolation at the directory and backend level, preventing accidental cross-region variable injection. This approach ensures that each region's configuration has its own dedicated variable files and state, eliminating the risk of a `terraform.tfvars` file from one workspace affecting another. It aligns with infrastructure-as-code best practices for multi-region deployments where environment boundaries must be explicit.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Implement a CI/CD pipeline that runs `terraform plan` for every workspace and requires manual approval before apply

    Why it's wrong here

    Doesn't prevent using wrong variable values; manual approval can still approve misconfigurations.

  • Use the same S3 backend for all regions but with different state file keys, and enforce naming conventions

    Why it's wrong here

    Still shares variable files; naming conventions don't prevent mistakes.

  • Store all variables in a single `terraform.tfvars` file and use conditionals with `terraform.workspace` to select values

    Why it's wrong here

    Single file can still be misconfigured; conditionals may become complex and error-prone.

  • Create separate Terraform configurations for each region, each with its own backend configuration and variable files, and use directory structure to enforce separation

    Why this is correct

    Physical separation prevents accidental use of wrong variable files.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume workspaces provide sufficient isolation for multi-region deployments, but workspaces share the same variable files and backend configuration, making them unsuitable for preventing cross-region variable misconfigurations.

Detailed technical explanation

How to think about this question

Terraform workspaces share the same configuration code and variable files, meaning a variable like `target_region` defined in a `terraform.tfvars` file applies to all workspaces unless overridden per workspace—this is a common source of cross-environment pollution. By using separate directories, each with its own `backend.tf` and `terraform.tfvars`, you leverage filesystem isolation to guarantee that state files and variable values are never accidentally shared. In real-world scenarios, this pattern also simplifies role-based access control (RBAC) and audit trails, as each region's configuration can be managed by different teams or pipelines.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related TF-003 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free TF-003 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this TF-003 question test?

Understand Terraform basics — This question tests Understand Terraform basics — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Create separate Terraform configurations for each region, each with its own backend configuration and variable files, and use directory structure to enforce separation — Option D is correct because creating separate Terraform configurations for each region enforces strict isolation at the directory and backend level, preventing accidental cross-region variable injection. This approach ensures that each region's configuration has its own dedicated variable files and state, eliminating the risk of a `terraform.tfvars` file from one workspace affecting another. It aligns with infrastructure-as-code best practices for multi-region deployments where environment boundaries must be explicit.

What should I do if I get this TF-003 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This TF-003 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-003 exam.