Terraform Infrastructure Engineer Professional (002) · Sample questions
10 real questions from the CertifyDeck Terraform Infrastructure Engineer Professional (002) bank, spread across the domains of the official HashiCorp Certified: Terraform Infrastructure Engineer Professional (002) skills outline, with the correct answer and a full explanation of why the other options are wrong. They are original questions written from the public syllabus, not exam dumps, and they are the same style you will find in the practice tests and mock exams.
Correct answer: B. Upload a speculative configuration version and create a plan-only run from it
In HashiCorp's GitHub Actions tutorial the pull request workflow uploads the configuration marked as speculative, so it cannot modify infrastructure, and creates a plan-only run whose link is posted to the pull request. A normal run can be confirmed and applied before anyone discards it, a refresh-only apply writes state, and a saved plan cannot be applied to HCP Terraform remote operations.
Correct answer: C. Create the configuration version with auto-queue-runs = false and create the run after approval
auto-queue-runs defaults to true, which queues a run as soon as the archive is uploaded; when it is explicitly false, you create the run on the workspace yourself, here after approval. A speculative configuration version can only produce runs that can be neither confirmed nor applied. provisional controls whether the version becomes the current one, not whether a run is queued, and archiving discards the uploaded files, which HCP Terraform cannot re-fetch for API uploads.
Correct answer: C. Terraform plans to destroy the objects at the old addresses and create new ones at the new addresses
Removing a moved block is a breaking change: a configuration whose objects are still at the old address no longer has the instruction to move them, so Terraform plans to delete them and create new ones. That is why the documentation recommends keeping all historical moved blocks, removing them only for private modules when you are certain that every user has applied the new version. Nothing records the move outside the configuration, and Terraform does not infer renames from matching resource types.
Correct answer: C. The server has no valid TFE_TOKEN, so it does not register the registry-private tools
The server registers the tools of the registry-private and terraform toolsets only when it has a valid TFE_TOKEN, so without a token only the public registry tools appear. ENABLE_TF_OPERATIONS gates destructive operations such as applying runs, not private registry searches, and the transport only determines how the client and server exchange messages.
Correct answer: A. Policies enforced globally, with the sandbox project selected as an exclusion
A globally enforced policy set covers all existing and future workspaces, and excluding a project exempts every workspace in it, including ones created later. Listing the other projects would miss projects created in the future, and excluding today's sandbox workspaces by name would not cover new ones. Tag scopes select workspaces that have the chosen tags; they cannot match workspaces that lack a tag.
Correct answer: D. Add a mock_provider block for the provider to the test file and assert on the planned or applied names
A mock_provider returns the provider's schema, sets values from the configuration and generates fake data for computed attributes, so tests can run without creating infrastructure or requiring credentials. -cloud-run executes the same tests remotely with credentials configured on the registry module and still builds real resources. A setup helper module creates real resources, and a check block only reports warnings during real plan and apply operations.
Correct answer: D. Set on_failure = continue on the provisioner
A failing creation-time provisioner fails the apply and marks the resource as tainted, so Terraform destroys and recreates it on the next apply; on_failure = continue tells Terraform to ignore the error and continue. when = destroy would move the notification to destroy time, ignore_changes only affects how attribute updates are planned and does not prevent tainting, and create_before_destroy only changes the order of a replacement.
Correct answer: B. Remove version and append ?ref=v1.4.0 to the source address
The version argument only applies to modules installed from a registry; for Git sources you select a branch, tag or SHA-1 hash with the ref query parameter in the source address. required_version constrains the Terraform CLI, not modules, -upgrade does not make version valid for a Git source, and depth only makes a shallow clone of whatever ref is selected.
Correct answer: B. terraform plan -refresh-only
terraform plan -refresh-only shows how the state would change to match remote objects without modifying anything, and it is preferred over the terraform refresh subcommand, which overwrites the state file without displaying the updates. -refresh=false skips synchronising with remote objects, so it hides the drift, and an auto-approved refresh-only apply writes the detected changes to state.
Correct answer: D. terraform version
The version subcommand prints the Terraform CLI version and the versions of the providers the configuration is using, and it also says when a newer Terraform release is available. terraform providers lists where requirements are declared, terraform show -json renders state or a plan, and terraform providers schema -json prints provider schemas.
Answer each question before opening the explanation, and write down why you discarded the other options. On Terraform Infrastructure Engineer Professional (002), most mistakes come from choosing an option that is technically possible but does not meet every requirement in the scenario.
These 10 questions are a taste of the format, not a diagnostic. To know which domains you fail, practice by domain for free and take a timed mock exam that mirrors the official weights and duration.
Start for free, no sign-up or card. Every question includes an explanation like the ones above, and the mock exam reproduces the official Terraform Infrastructure Engineer Professional (002) format.