Home › Terraform 004 › Practice questions › Terraform fundamentals
Terraform 004 · HashiCorp · Terraform fundamentals · Bank updated 2026-11-03

Terraform 004 practice questions: Terraform fundamentals

5 free questions from 38 on this area · answer and explanation for each · no sign-up

These 5 questions come from the Terraform fundamentals section of our Terraform 004 bank (38 questions on this area, which carries 12.5% of the real exam). Every question is original, with the correct answer explained and linked to the source it is drawn from.

Try 6 free Terraform 004 questions → All Terraform 004 sample questions

Free: 6 questions in study mode, no card. All 38 Terraform fundamentals questions and the full Terraform 004 bank: $15 one-time.

1/5 · Terraform fundamentals
The state file of a workspace was corrupted and no backup exists. All objects the workspace managed still exist in the cloud account, and each carries a Name tag matching its resource name in the code. An engineer deletes the state file and runs terraform plan. What does the plan propose?
AA create action for each resource declared in the configuration
BNo changes, after objects are matched to resources by Name tag
CNo changes, after a refresh reads each object back from the provider
DAn import for each object whose Name tag matches a resource name
Answer: A. The Mapping to the Real World section of Purpose of Terraform State explains that early prototypes used tags, but not all resources and not all cloud providers support them, so Terraform maps configuration to real-world objects through its own state structure. With the state gone, plan compares the configuration with an empty prior state and proposes to create each resource, even though matching objects exist. Bringing those objects back under management means importing them into state. Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
2/5 · Terraform fundamentals · easy
An engineer inspects a directory that uses the default local backend and finds a terraform.tfstate.d directory next to the configuration files. What does its presence indicate?
AA remote backend was configured and this directory caches its settings
BProvider plugins were downloaded here for several different versions
CThe directory uses multiple workspaces with state kept locally
DA previous apply was interrupted and left partial state behind
Answer: C. With the default local backend, Terraform keeps state in a terraform.tfstate file when only the default workspace is used, and in a terraform.tfstate.d directory when the directory uses multiple workspaces. Plugins, modules and backend records belong to the hidden .terraform directory. Source: tf-cli-init, Working Directory Contents, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
3/5 · Terraform fundamentals · hard
A developer works in a directory that was initialized last week and makes one edit to the configuration. Which edit means the directory must be reinitialized before normal operations can continue?
Achanging the cidr_block value of an existing VPC resource
Badding a description to an input variable
Cadding a new provider to the required_providers block
Dmoving a resource block into a different file
Answer: C. Reinitialization says certain changes require running init again: changes to provider requirements, module sources or version constraints, and backend configurations. Editing resource arguments, variable descriptions or file layout is not in that list. Source: tf-cli-init, Reinitialization, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
4/5 · Terraform fundamentals
A developer clones a repository that contains Terraform configuration files. Nothing has been run in the clone yet, and there is no hidden .terraform directory. The developer's first command is terraform plan. What is the outcome?
Athe command fails with an error that explains the setup step still missing
Bthe command prepares the directory silently, then goes on to produce the plan
Cthe command builds a plan from the resources that need no provider plugins
Dthe command asks the user whether to continue without preparing the directory
Answer: A. A working directory must be initialized before operations such as plan or apply. If you run a command that relies on initialization without first initializing, it fails with an error that explains you need to run init. Terraform does not initialize the directory on its own in that situation. Source: tf-cli-init, Initialization, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
5/5 · Terraform fundamentals · easy
A team splits its Terraform code into network.tf and compute.tf, and keeps further .tf files in a nested folder of the same project. A new engineer asks how the Terraform documentation defines a configuration. Which description fits?
Aa complete document in the Terraform language that can consist of multiple files and directories
Ba single main.tf file in each working directory, with other files and directories treated as modules
Cthe .tf files in the root directory, while files and directories below it are ignored
Done file per provider, merged by Terraform in alphabetical order across files and directories
Answer: A. The documentation defines a Terraform configuration as a complete document in the Terraform language that tells Terraform how to manage a collection of infrastructure, and it allows that document to consist of multiple files and directories. Splitting code across network.tf, compute.tf and a nested folder therefore still forms one configuration. Source: tf-language, https://developer.hashicorp.com/terraform/language, About the Terraform Language, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
Try 6 more free Terraform 004 questions → See the whole Terraform 004 bank

Other Terraform 004 areas

The same kind of free sample for every other section of the Terraform 004 bank:

Infrastructure as Code (IaC) with Terraform29 qCore Terraform workflow33 qTerraform configuration29 qTerraform modules28 qTerraform state management44 qMaintain infrastructure with Terraform23 qHCP Terraform24 q

Practise Terraform 004 with instant feedback

6 free questions in study mode · no card · full Terraform 004 bank with area filters and the error log: $15 one-time · no dumps, no ads.

Start Terraform 004 free →
Read next
Terraform Associate 004 vs 003: What Changed and How to Prepare in 2026 HashiCorp retired Terraform Associate 003 on 8 January 2026. What 004 changed, the four new topics, what it means for 003 holders, and a 5-week plan.
ExamDeck is an independent study tool, not affiliated with, endorsed by, or sponsored by HashiCorp. Terraform 004 and related marks are trademarks of their respective owners, used for identification only. Exam facts checked against official HashiCorp materials (as of October 2026); always confirm current details with the vendor before booking.