Courseiva

TF-004 · topic practice

Understand Terraform basics practice questions

Practise HashiCorp Terraform Associate TF-004 Understand Terraform basics practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Reviewed byJohnson Ajibi· MSc IT Security
20 questionsDomain: Understand Terraform basics

What the exam tests

What to know about Understand Terraform basics

Understand Terraform basics questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Understand Terraform basics exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Practice set

Understand Terraform basics questions

20 questions · select your answer, then reveal the explanation

An organization uses Terraform Cloud for remote state management. They have a workspace that uses the CLI-driven run workflow. A developer runs `terraform plan` locally and sees that the plan succeeds. However, when they push the same configuration to the version control system (VCS) connected to the workspace, the plan fails with a state lock error. What is the most likely reason?

Which TWO of the following are true about Terraform state? (Choose two.)

Which three of the following are valid ways to pass variable values to a Terraform configuration?

Refer to the exhibit. What will happen when terraform plan is run?

Exhibit

resource "aws_s3_bucket" "example" {}

Refer to the exhibit. What does this output indicate?

Exhibit

Output of `terraform state list`:
aws_instance.web

Refer to the exhibit. What is the most likely cause of this error?

Exhibit

Error: Could not satisfy version constraint for provider hashicorp/aws: required version >= 3.0, installed version 2.70

A team uses Terraform to manage AWS resources. They want to ensure that a security group is created before an EC2 instance that references it. What is the best practice?

In Terraform, which command is used to format configuration files according to the HCL canonical style?

Which of the following commands creates an execution plan that shows what resources will be created, updated, or destroyed?

A team manages infrastructure with Terraform. They recently updated the provider version in the configuration from 2.0 to 3.0. After running `terraform init`, they get errors that some resource arguments are no longer valid. What is the best approach to resolve this?

Which TWO of the following are valid variable types in Terraform? (Choose two.)

Which TWO of the following are valid ways to pass variable values to a Terraform configuration? (Choose two.)

Which THREE of the following are characteristics of Terraform state? (Choose three.)

A DevOps engineer is working on a Terraform project that manages resources across multiple AWS accounts. To reduce duplication and ensure consistency, they want to define common configurations like provider settings and variable definitions in a separate location that can be reused across root modules. What feature should they use?

An organization uses Terraform Cloud to manage their infrastructure. They have a workspace configured with a VCS-backed workflow connected to their GitHub repository. They recently added a new AWS provider version requirement in their configuration. After committing and pushing the change, they notice that the plan in Terraform Cloud fails with an error indicating that the provider version is not found. However, the engineer can run the same configuration locally with terraform init and plan successfully. What is the most likely reason for the failure in Terraform Cloud?

A platform team manages a large Terraform codebase with hundreds of resources across multiple environments (dev, staging, prod). They use terraform workspaces to manage environment-specific state files. Recently, an engineer made changes to the production workspace but forgot to switch from the dev workspace before applying. The apply was successful, but now the production resources are in an inconsistent state. The team wants to recover the production state to match the actual infrastructure. The previous state file for production was backed up in an S3 bucket before the accidental apply. What is the best course of action?

Which TWO of the following statements about Terraform state are correct? (Choose two.)

Refer to the exhibit. The engineer runs terraform plan and gets:

Error: Reference to undeclared data source on main.tf line 6, in resource "aws_security_group" "example": 6: vpc_id = data.aws_vpc.selected.id

A data source "aws_vpc" "selected" is declared but not yet read. What is the most likely cause?

Exhibit

data "aws_vpc" "selected" {
  default = true
}

resource "aws_security_group" "example" {
  name   = "example-sg"
  vpc_id = data.aws_vpc.selected.id
}

output "vpc_id" {
  value = data.aws_vpc.selected.id
}

A DevOps engineer is writing a Terraform configuration to provision an AWS EC2 instance. They want to ensure that the instance is replaced if the AMI ID changes, but not if the instance type changes. Which lifecycle meta-argument should be used?

A team is using Terraform to manage infrastructure across multiple environments (dev, staging, prod). They want to reuse the same root module configuration but with different variable values. Which approach is the most efficient?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Understand Terraform basics sessions

Start a Understand Terraform basics only practice session

Every question in these sessions is drawn from the Understand Terraform basics domain — nothing else.

Related practice questions

Related TF-004 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the TF-004 exam test about Understand Terraform basics?
Understand Terraform basics questions test whether you can apply the concept in context, not just recognise a definition.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Understand Terraform basics questions in a focused session?
Yes — the session launcher on this page draws every question from the Understand Terraform basics domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other TF-004 topics?
Use the topic links above to move to related areas, or go back to the TF-004 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the TF-004 exam covers. They are not copied from any real exam or dump site.