Terraform 004 · HashiCorp · Terraform modules · Bank updated 2026-11-03
Terraform 004 practice questions: Terraform modules
5 free questions from 28 on this area · answer and explanation for each · no sign-up
These 5 questions come from the Terraform modules section of our Terraform 004 bank (28 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.
Free: 6 questions in study mode, no card. All 28 Terraform modules questions and the full Terraform 004 bank: $15 one-time.
1/5 · Terraform modules
A team keeps its VPC module in a Git repository and tags each release, for example 1.1.0, 1.2.0 and 1.3.0. The calling configuration has module "vpc" with source = "git::https://example.com/vpc.git". The team wants terraform init to install the 1.2.0 release on every machine. Which change achieves that?
AAdd version = "1.2.0" to the module "vpc" block
BAppend //1.2.0 to the end of the source string
CAdd required_version = "1.2.0" to the terraform block
DAppend ?ref=1.2.0 to the end of the source string
Answer: D. The module block reference, Specification > version, states: 'You can only use the version argument when the source argument points to a module listed in a registry, such as the public Terraform Registry or HCP Terraform's private module registry.' For Git sources, the ref query parameter 'Specifies a branch name, full or short SHA-1 hash, or tag name to clone', and the Install a specific revision example clones a module tagged as v1.2.0 by appending ?ref=v1.2.0 to a git:: source address. A // in the source instead marks a sub-directory within the package.
Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
2/5 · Terraform modules
An engineer wants an empty directory to start as a copy of a module published in a Git repository, so she can edit those files as the root configuration of a new project. Which command does this?
Aterraform apply -from-module=SOURCE in the empty directory
BA module block with source = SOURCE in main.tf, then terraform init
Cterraform init -from-module=SOURCE in the empty directory
Dterraform plan -from-module=SOURCE in the empty directory
Answer: C. The init command reference says init can be run against an empty directory with the -from-module=MODULE-SOURCE option, and that the given module is then copied into the target directory before any other initialization steps run. A module block only references a module, so the copy-into-an-empty-directory workflow is a separate init option. Source: https://developer.hashicorp.com/terraform/cli/commands/init
Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
3/5 · Terraform modules
A module call receives no argument that references a queue policy resource, yet none of the module's resources may be touched until every operation on that policy resource is finished. Terraform otherwise parallelizes module resource creation. How should the module block be configured to guarantee this order?
APlace the module block after the policy resource in the file
BPass the policy name to the module as a literal string input
CAdd a count argument so the module is evaluated later
DSet depends_on in the module block to the policy resource
Answer: D. Terraform detects an implicit dependency when a module's arguments reference a resource. Without such a reference, you can configure the dependency explicitly with depends_on in the module block; Terraform then completes all operations on the upstream resource before operating on the module.
Source: tf-language-modules, Set dependencies, p. 1
Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
4/5 · Terraform modules · hard
An operator wants to recreate every resource inside module "app" in one step and runs terraform apply -replace=module.app. Which statement about this use of the option is correct?
Ait replaces all resources in the module, including nested modules
Bit replaces only resources defined directly in that module, skipping nested ones
Cit can target only individual resource instances, not a module as a whole
Dit works on a module only when the module block uses count
5/5 · Terraform modules
A configuration defines a default aws provider configuration and a second one with the alias "eu". Only the module "reporting" must create its resources through the aliased configuration, while everything else keeps the default. What should the engineer do?
Aadd a provider argument to the reporting module block that points at the aliased eu configuration
Badd a second source argument to the reporting module block that names the aliased configuration
Crerun terraform init with the -upgrade flag so the aliased configuration replaces the default one
Dadd a depends_on argument to the reporting module block that lists the aliased configuration
Answer: A. By default Terraform applies the default provider based on the resource type, but you can create multiple provider configurations and use a non-default one for specific modules by adding a provider argument to the module block.
Source: tf-language-modules, Use an alternate provider configuration, p. 1
Source: HashiCorp Terraform Associate (004) exam objectives and Terraform documentation
Other Terraform 004 areas
The same kind of free sample for every other section of the Terraform 004 bank:
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 →
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.