HashiCorp TA-002-P Exam
HashiCorp Certified: Terraform Associate (Page 8 )

Updated On: 7-Feb-2026

Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?

  1. servers = num_servers
  2. servers = variable.num_servers
  3. servers = var(num_servers)
  4. servers = var.num_servers

Answer(s): D

Explanation:

"Within the module that declared a variable, its value can be accessed from within expressions as var.<NAME>, where <NAME> matches the label given in the declaration block:
Note: Input variables are created by a variable block, but you reference them as attributes on an object named var."


Reference:

https://www.terraform.io/language/values/variables#using-input-variable-values



A Terraform provisioner must be nested inside a resource configuration block.

  1. True
  2. False

Answer(s): A

Explanation:

Most provisioners require access to the remote resource via SSH or WinRM, and expect a nested connection block with details about how to connect.


Reference:

https://www.terraform.io/docs/language/resources/provisioners/connection.html



Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.

  1. True
  2. False

Answer(s): B


Reference:

https://www.terraform.io/downloads



What does the default "local" Terraform backend store?

  1. tfplan files
  2. Terraform binary
  3. Provider plugins
  4. State file

Answer(s): D

Explanation:

The local backend stores state on the local filesystem, locks that state using system APIs, and performs operations locally.


Reference:

https://www.terraform.io/docs/language/settings/backends/local.html



You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?

  1. Run the terraform fmt command during the code linting phase of your CI/CD process
  2. Designate one person in each team to review and format everyone's code
  3. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)
  4. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed

Answer(s): A


Reference:

https://www.terraform.io/cli/commands/fmt



Viewing page 8 of 91
Viewing questions 36 - 40 out of 449 questions



Post your Comments and Discuss HashiCorp TA-002-P exam prep with other Community members:

Join the TA-002-P Discussion