Home › Certifications › Terraform Associate 004 › The Core Workflow
35 multiple-choice questions and 20 flashcards on The Core Workflow, about 14% of the Terraform Associate 004 bank. Every one carries a written rationale.
The Core Workflow is one of 8 chapters in CoStudy's Terraform Associate (004) bank, and it holds 35 of the bank's 250 multiple-choice questions — roughly 14% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.
Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.
10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.
During an outage an engineer uses `-target` to apply a single resource, and afterwards proposes making it the team's standard practice to keep applies fast. The BEST response is:
Answer: D — Reject it: targeting is documented for exceptional recovery, and routine use leaves state inconsistent with the configuration
D) Correct — HashiCorp positions `-target` as an escape hatch for recovering from errors, warning that habitual use produces state that no longer reflects the whole configuration. A) is the misconception the warning exists to counter; splitting configurations is the supported answer to slow plans. B) narrows the bad advice without fixing it — targeted destroys carry the same inconsistency risk. C) confuses two unrelated flags: skipping refresh changes how state is reconciled, not which objects are in scope.
Which statement about 'terraform apply' confirmation is correct?
Answer: B — apply prompts for approval unless -auto-approve or a saved plan file is given.
B is right: interactive apply shows the plan and waits for a yes, and there are exactly two ways to skip that — pass -auto-approve, or hand apply a plan file that was already reviewed. A misses the default prompt entirely. C invents a transport requirement; Terraform talks to provider APIs, not hosts. D invents a setting — the terraform block configures required_version, required_providers, backend and cloud, not prompting.
A team runs 'terraform plan' but skips saving the plan file with -out. What is the risk on apply?
Answer: A — apply recomputes the plan, which may differ from the one that was reviewed.
A is right: without -out there is no artifact to hand to apply, so apply re-plans from current state and real infrastructure, and the result can differ from what a reviewer approved. B assumes a plan cache that does not exist. C is wrong because apply runs happily with no plan file, just with a confirmation prompt. D names a file Terraform never writes. For change control, always run plan -out=FILE and apply that exact file.
What does 'terraform plan' do?
Answer: E — Generates an execution plan of pending changes; -out saves it for a later apply run
E is right: plan refreshes, compares desired configuration with recorded state and reports creates, updates, destroys and replacements without changing anything; -out=plan.bin lets apply execute exactly what was reviewed. A is apply, B is closer to terraform show, C is destroy and D is validate.
A pipeline runs `terraform plan -out=tfplan`, waits for a human approval step, then runs `terraform apply tfplan`. Which statement about the apply is correct?
Answer: B — The apply executes exactly the actions recorded in the saved plan, without asking for confirmation
B) Correct — a saved plan already encodes the decided actions and the variable values used, so apply proceeds without an interactive prompt. A) contradicts the documented behaviour; the confirmation prompt exists only when apply computes its own plan. C) would defeat the purpose of a saved plan and is not what happens. D) is wrong on the mechanics: the resolved variable values are captured in the plan file, which is also why plan files must be treated as sensitive.
Which command formats Terraform configuration files to canonical style?
Answer: D — terraform fmt
Trick: the command is 'fmt' (like gofmt), not 'format' or 'style'. -check returns nonzero if files would be changed (useful in CI).
Which command downloads provider plugins and configures the backend for a working directory?
Answer: C — terraform init
Trick: right-command/wrong-use archetype. 'terraform get' downloads modules only (mostly obsolete; init handles it). init does providers AND backend AND modules.
An auditor changed tags on several managed resources directly in the provider console. The team wants Terraform's state to acknowledge reality before deciding what to do, without altering any infrastructure. Which command fits BEST?
Answer: A — terraform apply -refresh-only
A) Correct — a refresh-only apply reconciles state with what the provider reports and proposes no changes to real resources, which is exactly the requested outcome. B) forces replacement of a resource, a destructive action and the modern successor to the deprecated taint workflow, not a state reconciliation. C) previews destroying everything the configuration manages, which is not what is wanted. D) re-initialises the backend and has no relationship to detecting or absorbing drift.
If 'terraform apply' fails partway through, what is the state file's condition?
Answer: B — State records what was created up to the failure; some resources may be partial.
B is right: Terraform writes state as it goes, so a failed apply leaves a real record of everything that succeeded, plus resources that were created but not fully configured and are flagged for replacement on the next run. A is the rollback misconception — there are no transactions across provider APIs. C is invented behaviour. D confuses a crashed run, which can leave a stale lock, with the normal failure path. Re-running plan and apply usually reconciles the difference.
What does 'terraform validate' check?
Answer: B — Internal consistency of the configuration, syntax and arguments, with no API calls
B is right: validate is a local check of syntax, argument names, types and references after init, with no remote calls and no state access. A and C require a plan against a real account. D is cost estimation. E is not a Terraform function at all. Custom conditions such as variable validation blocks are also evaluated here.
4 cards from the 20 in this chapter.
terraform init -upgrade?
Force upgrade providers/modules to latest acceptable versions.
terraform validate?
Check syntax/configuration without making API calls.
terraform init?
Initialize working directory. Downloads providers, sets up backend.
What does terraform validate check, and what does it deliberately NOT check?
It checks that the configuration is syntactically valid and internally consistent — correct block structure, valid argument names, correct types where known, and resolvable references. It does not contact any provider API or the remote state, so it cannot tell you whether the infrastructure exists, whether credentials work, or what will actually change.
These are a sample. The full The Core Workflow chapter runs 55 items with per-chapter progress tracking, on the web and in the iOS app.
Open Terraform Associate 004 in CoStudy →