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

Terraform 004 practice questions: Core Terraform workflow

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

These 5 questions come from the Core Terraform workflow section of our Terraform 004 bank (33 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 33 Core Terraform workflow questions and the full Terraform 004 bank: $15 one-time.

1/5 · Core Terraform workflow · easy
A repository root holds main.tf and variables.tf. Below it, modules/network and modules/storage each hold a single main.tf, and the root calls only the network module. All four files have misaligned equals signs. From the repository root, an engineer runs terraform fmt with no flags and no target. How many of the four files does Terraform rewrite?
ATwo files
BThree files
CFour files
DNo files
Answer: A. The terraform fmt command page, Usage, states that by default the command 'scans your current directory for configuration files'. It describes -recursive as: 'Processes files in subdirectories in addition to the current directory. By default, the command only processes the specified, or current, directory.' Running terraform fmt -recursive from the root would also reformat both module directories. Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
2/5 · Core Terraform workflow
A team provisioned a dev environment from one configuration directory and expects to provision similar resources there again next quarter. They want every managed object removed now. Which statement describes what terraform destroy does in this situation?
AIt has the same effect as removing every resource from the configuration and applying, with no file edit needed
BIt rewrites the configuration files to drop every resource block, then applies and commits that edit
CIt deletes every object in the provider account that resembles the configuration, without consulting state data
DIt removes every managed object without a confirmation step, as no configuration change is being applied
Answer: A. Per the Destroy section, terraform destroy removes all resources managed by the current working directory and workspace, using state data to find the real objects. It behaves exactly like deleting every resource from the configuration and applying, but needs no configuration edit, and it asks for confirmation like apply. Source: tf-cli-run, Destroy, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
3/5 · Core Terraform workflow · hard
A working directory is initialized and has two workspaces, dev and staging, each tracking its own set of real infrastructure objects from the same configuration. An engineer selects staging, runs terraform destroy and confirms the prompt. What does the command act upon?
Aonly the real objects tracked in the staging workspace state
Bthe objects tracked in both the dev and staging workspaces
Conly the objects staging created during its most recent apply
Devery resource the configuration declares, tracked or not
Answer: A. Plan, apply and destroy all require an initialized working directory and act only on the currently selected workspace. Destroy then uses state data to determine which real objects correspond to managed resources, so only the staging objects are removed. Source: tf-cli-run, https://developer.hashicorp.com/terraform/cli/run, Workflows and Destroy, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
4/5 · Core Terraform workflow
A team has connected the CLI to a cloud block so that input variables and state live in a central remote location. A new engineer joins and wants to edit configuration and run speculative plans against the latest state with all stored variables. What does the engineer need?
Alocal copies of the sensitive variable values, kept on their machine
Ba downloaded copy of the latest state file, kept on their machine
Can API key for HCP Terraform, configured on their machine
Da personal account on the team's shared CI environment
Answer: C. HCP Terraform stores input variables and state centrally and securely. With the CLI integration configured, an API key is all team members need to edit config and run speculative plans against the latest state using the remotely stored variables. Source: tf-intro-core-workflow, https://developer.hashicorp.com/terraform/intro/core-workflow, Write, p. 1 Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
5/5 · Core Terraform workflow
A developer clones a repository that holds only .tf files onto a fresh laptop. Before terraform plan, terraform apply or terraform destroy can run against that clone, what must be done first?
Aselecting a dedicated workspace for the directory
Brunning terraform init in the directory
Csaving a plan file for the directory
Dcommitting the directory to a version control branch
Answer: B. The Workflows section states that plan, apply and destroy all require an initialized working directory. A fresh clone with only configuration files is not initialized, so terraform init comes first. Workspace selection, saved plans and commits are not prerequisites for these commands. Source: tf-cli-run, Workflows, 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 qTerraform fundamentals38 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.