Practice questions · IT & Cloud
HashiCorp Terraform Associate (004): Practice Questions
Original concept-check questions for the HashiCorp Terraform Associate (003). They cover the objectives the exam tests - IaC concepts, the core workflow, configuration, state and modules - with every answer explained, including why the others are wrong. Filter by area or difficulty. These are concept checks, not real exam questions.
Answered 0 · Correct 0
-
Infrastructure as code (IaC) means:
Correct answer: D. IaC defines infrastructure in configuration files so it can be versioned and reproduced. Clicking in a cloud console is the manual approach IaC replaces, a virtual machine is a compute resource (not a practice), and a billing model is how you pay, not how you provision. -
A key advantage of infrastructure as code is:
Correct answer: C. With IaC, changes live in code, so they are versioned, reviewable and repeatable. IaC still needs a cloud account, it makes changes more repeatable (not less), and tools like Terraform work across many providers, not just one. -
A defining strength of Terraform versus some other IaC tools is that it is:
Correct answer: B. Terraform is provider-agnostic across many platforms. It is not single-cloud, networking-only, or primarily a config-management tool. -
Terraform's execution model is best described as:
Correct answer: B. Terraform is declarative: you describe the desired end state and it computes the steps to get there. It is not random, it is not manual-only, and it is not imperative step-by-step scripting (which is what shell scripts or some other tools do). -
A Terraform provider is:
Correct answer: C. A provider is a plugin (such as AWS, Azure or GCP) that lets Terraform manage a platform's resources. It is not a variable (which holds a value), not a billing account, and not the state file (which records what Terraform manages). -
terraform init is the command that:
Correct answer: C. `init` prepares the working directory and downloads the providers and modules the configuration needs. Importing existing resources into state is `terraform import`, tearing down infrastructure is `terraform destroy`, and applying changes is `terraform apply`. -
A 'resource' block in Terraform describes:
Correct answer: B. A resource block declares a piece of infrastructure that Terraform creates and manages. Reading existing data without managing it is a data source, while a billing alert and a log message are not Terraform configuration concepts. -
A 'data source' differs from a resource because it:
Correct answer: D. A data source reads existing information without creating or managing anything; a resource creates and manages infrastructure. It does not lock the backend, store the state file, or create new infrastructure. -
The Terraform core workflow is:
Correct answer: D. The core workflow is write, then plan, then apply (with destroy to tear down). The other sequences put the steps out of order: you cannot apply or destroy before writing config and planning. -
terraform plan is used to:
Correct answer: D. `plan` previews the changes needed to reach the desired state without making them. Deleting state, downloading providers (that is `init`), and editing the backend are different actions. -
terraform apply does what after you confirm?
Correct answer: D. `apply` makes the changes needed to reach the desired state. It does not just print help, remove the provider, or generate documentation. -
terraform destroy is used to:
Correct answer: C. `destroy` removes the infrastructure Terraform manages. Initialising a directory is `init`, formatting code is `terraform fmt`, and previewing changes is `plan`. -
Running plan before apply is valuable mainly because it:
Correct answer: B. `plan` lets you review the additions, changes and deletions before they happen, acting as a safety check. It does not make `apply` unnecessary, it does not speed up provider downloads, and it does not delete state. -
An input variable in Terraform lets you:
Correct answer: C. Input variables parameterise a configuration with values passed in at run time. Storing state, downloading a provider (that is `init`), and locking the backend are unrelated functions. -
An output value is used to:
Correct answer: D. An output exposes a result, such as an IP address, after `apply`. It does not delete a resource, hide results, or initialise the directory. -
Terraform usually determines the order to create resources by:
Correct answer: C. Terraform builds a dependency graph by inferring relationships from references between resources (and `depends_on` for explicit order). It does not order by file name, resource size, or randomly. -
Built-in functions in Terraform are used to:
Correct answer: D. Built-in functions transform values (strings, numbers, collections) inside the configuration. They do not store state remotely, replace the provider, or have anything to do with proctoring. -
To set an explicit dependency that Terraform cannot infer, you use:
Correct answer: D. `depends_on` declares an explicit dependency Terraform cannot infer from references. A backend block configures state storage, `terraform init` prepares the directory, and a data source reads existing information. -
Terraform state is:
Correct answer: B. State is Terraform's record of the real resources it manages, mapping configuration to the real world. It is not a billing report, a provider, or an exam objective weight. -
Remote state (in a shared backend) is mainly used to:
Correct answer: A. Remote state in a shared backend lets a team collaborate safely on the same infrastructure. It does not make Terraform single-user, avoid the need for providers, or skip the plan step. -
State locking prevents:
Correct answer: B. State locking stops concurrent operations from corrupting the state by writing at the same time. It does not block provider downloads, prevent variables from being set, or stop anyone from reading state. -
A Terraform 'backend' determines:
Correct answer: A. A backend determines where state is stored and, for some backends, where operations run. It has nothing to do with which exam version you take, the number of variables allowed, or the CLI colour. -
Storing state locally on one laptop is risky for a team because:
Correct answer: C. Local state is not shared, can be lost with the laptop, and offers no locking, so teams use remote backends. It is not always encrypted, it can store resources, and it does not run `plan` automatically. -
terraform import is used to:
Correct answer: A. `import` brings existing, unmanaged infrastructure under Terraform management by recording it in state. Formatting config is `terraform fmt`, downloading a module happens during `init`, and deleting state is a different action. -
A Terraform module is:
Correct answer: A. A module is a reusable, parameterised group of resources with inputs and outputs. It is not the state lock, a single variable, or a provider plugin. -
The Terraform Registry is:
Correct answer: D. The Terraform Registry is a source of official and community modules and providers. It is not the state backend, a billing dashboard, or a proctoring tool. -
You pass values into a module using:
Correct answer: C. You pass values into a module through its input variables; the module returns results via outputs. The state file, output values alone, and a destroy command are not how you supply inputs. -
Pinning a module to a specific version is good practice because it:
Correct answer: B. Pinning a module version prevents unexpected changes when a new release is published upstream. It does not disable the provider, remove the need for state, or make the module run faster. -
HCP Terraform (formerly Terraform Cloud) primarily provides:
Correct answer: D. HCP Terraform primarily provides remote runs, shared state and collaboration features. It does not give free unlimited compute, replace providers, or introduce a new programming language. -
A Terraform workspace lets you:
Correct answer: A. A workspace lets you keep multiple distinct states from one configuration, for example one per environment. It does not store provider binaries, replace the plan step, or encrypt the registry.
Practice questions FAQ
- Are these real Terraform Associate exam questions?
- No. These are original study questions written to test understanding. They are not real exam questions, exam dumps, or copied from any provider.
- How should I use these practice questions?
- Answer each one, read the explanation (including why the wrong options are wrong), and use the per-domain score below to focus your revision on weak areas. Revisit before exam day.
- How many questions should I do before the exam?
- Enough to score consistently across every domain, alongside full-length practice from official or reputable providers. Understanding why each answer is right matters more than raw volume.
- What score means I am ready?
- A good signal is consistently scoring around 80% or higher across all domains on questions you have not seen before, and being able to explain why the wrong options are wrong.
- Should I use exam dumps?
- No. Dumps (real or leaked questions) breach provider policy, can void your certification, and do not build the understanding the exam actually tests.