HashiCorp terraform associate 003 practice test

Exam Title: HashiCorp Certified: Terraform Associate (003)

Last update: Nov 27 ,2025
Question 1

What feature stops multiple users from operating on the Terraform state at the same time?

  • A. State locking
  • B. Version control
  • C. Provider constraints
  • D. Remote backends
Answer:

A


Explanation:
State locking prevents other users from modifying the state file while a Terraform operation is in
progress. This prevents conflicts and data loss1.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 2

Which of the following is not a valid string function in Terraform?

  • A. chomp
  • B. join
  • C. slice
  • D. split
Answer:

C


Explanation:
Referencing Terraform Built-in Functions:

chomp: removes trailing newlines

join: combines list into string

split: splits string into list

slice:is nota valid Terraform string function (it's used in other languages like Python)

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 3

What does the default "local" Terraform backend store?

  • A. tfplan files
  • B. State file
  • C. Provider plugins
  • D. Terraform binary
Answer:

B


Explanation:
The default “local” Terraform backend stores the state file in a local file named terraform.tfstate,
which can be used to track and manage the state of your infrastructure3.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 4

How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control
System (VCS) repository?

  • A. Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces
  • B. Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
  • C. Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
  • D. Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces
Answer:

B


Explanation:
This will trigger a run in the Terraform Cloud workspace, which will perform a plan and apply
operation on the infrastructure defined by the Terraform configuration files in the VCS repository.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 5

You're building a CI/CD (continuous integration/continuous delivery) pipeline and need to inject
sensitive variables into your Terraform run. How can you do this safely?

  • A. Copy the sensitive variables into your Terraform code
  • B. Store the sensitive variables in a secure_varS.tf file
  • C. Store the sensitive variables as plain text in a source code repository
  • D. Pass variables to Terraform with a -var flag
Answer:

D


Explanation:
This is a secure way to inject sensitive variables into your Terraform run, as they will not be stored in
any file or source code repository. You can also use environment variables or variable files with
encryption to pass sensitive variables to Terraform.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 6

When should you write Terraform configuration files for existing infrastructure that you want to start
managing with Terraform?

  • A. You can import infrastructure without corresponding Terraform code
  • B. Terraform will generate the corresponding configuration files for you
  • C. Before you run terraform Import
  • D. After you run terraform import
Answer:

C


Explanation:
You need to write Terraform configuration files for the existing infrastructure that you want to import
into Terraform, otherwise Terraform will not know how to manage it. The configuration files should
match the type and name of the resources that you want to import.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 7

Variables declared within a module are accessible outside of the module.

  • A. True
  • B. False
Answer:

B


Explanation:
Variables declared within a module are only accessible within that module, unless they are explicitly
exposed as output values1.

vote your answer:
A
B
A 0 B 0
Comments
Question 8

Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state
files. How can you protect that data?

  • A. Edit your state file to scrub out the sensitive data
  • B. Always store your secrets in a secrets.tfvars file
  • C. Delete the state file every time you run Terraform
  • D. Store the state in an encrypted backend
Answer:

D


Explanation:
This is a secure way to protect sensitive data in the state file, as it will be encrypted at rest and in
transit2. The other options are not recommended, as they could lead to data loss, errors, or security
breaches.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 9

If you update the version constraint in your Terraform configuration, Terraform will update your lock
file the next time you run terraform Init.

  • A. True
  • B. False
Answer:

A


Explanation:
If you update the version constraint in your Terraform configuration, Terraform will update your lock
file the next time you run terraform init3. This will ensure that you use the same provider versions
across different machines and runs.

vote your answer:
A
B
A 0 B 0
Comments
Question 10

Once you configure a new Terraform backend with a terraform code block, which command(s) should
you use to migrate the state file?

  • A. terraform destroy, then terraform apply
  • B. terraform init
  • C. terraform push
  • D. terraform apply
Answer:

A


Explanation:
This command will initialize the new backend and prompt you to migrate the existing state file to the
new location4. The other commands are not relevant for this task.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Page 1 out of 24
Viewing questions 1-10 out of 248
Go To
page 2