Terraform 004 sample questions: 5 examples
Five original scenario questions follow, one for each major area of the Terraform Associate (004) objectives. Pick an answer before reading the explanation, since the reasoning about the wrong options is the useful part. All five were written from HashiCorp’s published objective list; none comes from a real exam.
Question 1. A team runs terraform plan and sees one resource marked with a minus and plus sign together, meaning it will be replaced. What does Terraform do on apply?
- A. It updates the resource in place without interruption
- B. It destroys the existing object and creates a new one
- C. It leaves the resource unchanged and only updates state
- D. It asks the provider to roll the resource back
Show answer
Answer: B
A replace symbol means the change cannot be made in place, so the existing object is destroyed and a new one created (by default destroy first, unless create_before_destroy is set). It does not skip the resource, and plan itself changes nothing.
Want more questions like this? Full Terraform 004 practice tests →
Question 2. An engineer marks a database password variable as sensitive. Which statement about this is correct?
- A. The value is encrypted inside the state file
- B. The value can no longer be passed to resources
- C. The value is hidden in CLI output but still stored in state
- D. The value is removed from state after apply
Show answer
Answer: C
The sensitive setting redacts the value in CLI output but the value is still stored in the state file in plain text, so state must be protected, for example with an encrypted remote backend and restricted access. It does not encrypt state and it does not stop the value being used.
Want more questions like this? Full Terraform 004 practice tests →
Question 3. A module needs the ID of a subnet that the root module created. How should the child module receive it?
- A. The child module reads the parent’s local values automatically
- B. The child module reads the root state file directly
- C. It is exported as an environment variable on every plan
- D. The root module passes it as an input variable that the child declares
Show answer
Answer: D
A child module only sees what is passed in. The root module passes the value as an input variable declared in the child. Modules do not read the parent’s variables or locals implicitly, and state files are not shared that way.
Want more questions like this? Full Terraform 004 practice tests →
Question 4. Two engineers run terraform apply against the same remote backend at the same time. The backend supports locking. What happens?
- A. The second run cannot acquire the lock and does not proceed
- B. Both runs proceed and Terraform merges the changes
- C. The first run is cancelled automatically
- D. The second run proceeds in read-only mode and applies later
Show answer
Answer: A
State locking prevents concurrent operations that could corrupt state. The second run fails to acquire the lock and waits or errors, depending on options, until the first finishes. Both do not run, and locking does not merge changes.
Want more questions like this? Full Terraform 004 practice tests →
Question 5. A company wants to group several HCP Terraform workspaces so that access and settings can be managed together. Which feature fits?
- A. A variable set
- B. A project
- C. A run task
- D. A private registry
Show answer
Answer: B
Projects organize workspaces within an organization and let you apply access and settings at that level. A variable set shares variables, not workspaces, a run task calls external services during a run, and a private registry stores modules and providers.
Want more questions like this? Full Terraform 004 practice tests →
Keep going
Move on to the domain pages, starting with the core workflow. To place weak spots, use the study plan, and for logistics see the exam format.