HashiCorp terraform associate practice test

Exam Title: HashiCorp Certified: Terraform Associate Exam

Last update: Nov 27 ,2025
Question 1

Which of the following is not a key principle of infrastructure as code?

  • A. Versioned infrastructure
  • B. Golden images
  • C. Idempotence
  • D. Self-describing infrastructure
Answer:

ABD


Explanation:
Reference:
https://docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as
-
code#:~:text=Idempotence%20is%20a%20principle%20of,of%20the%20environment's%20starting%
20state.

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

Terraform variables and outputs that set the "description" argument will store that description in the
state file.

  • A. True
  • B. False
Answer:

B


Explanation:
Reference:
https://www.terraform.io/docs/language/values/outputs.html

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

What is the provider for this fictitious resource?

  • A. vpc
  • B. main
  • C. aws
  • D. test
Answer:

C


Explanation:
Reference:
https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html

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

If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

  • A. Run terraform refresh
  • B. It will happen automatically
  • C. Manually update the state fire
  • D. Run terraform import
Answer:

A


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

What is not processed when running a terraform refresh?

  • A. State file
  • B. Configuration file
  • C. Credentials
  • D. Cloud provider
Answer:

CD


Explanation:
Reference:
https://www.terraform.io/docs/cli/commands/refresh.html

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

What information does the public Terraform Module Registry automatically expose about published
modules?

  • A. Required input variables
  • B. Optional inputs variables and default values
  • C. Outputs
  • D. All of the above
  • E. None of the above
Answer:

E


Explanation:
Reference:
https://www.terraform.io/docs/registry/modules/publish.html

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

If a module uses a local variable, you can expose that value with a terraform output.

  • A. True
  • B. False
Answer:

A


Explanation:
Output values are like function return values.
Reference:
https://www.terraform.io/docs/language/values/locals.html
https://www.terraform.io/docs/language/values/outputs.html

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

You should store secret data in the same version control repository as your Terraform configuration.

  • A. True
  • B. False
Answer:

B


Explanation:
Reference:
https://blog.gruntwork.io/a-comprehensive-guide-to-managing-secrets-in-your-
terraform-code
- 1d586955ace1

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

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

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

C


Explanation:
Reference:
https://www.terraform.io/docs/language/functions/chomp.html

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

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud
command line tool. However, you are standardizing with Terraform and want to manage these VMs
using Terraform instead.
What are the two things you must do to achieve this? (Choose two.)

  • A. Provision new VMs using Terraform with the same VM names
  • B. Use the terraform import command for the existing VMs
  • C. Write Terraform configuration for the existing VMs
  • D. Run the terraform import-gcp command
Answer:

BD


Explanation:
The terraform import command is used to import existing infrastructure. Import existing Google
Cloud resources into Terraform with Terraformer.
Reference:
https://www.terraform.io/docs/cli/import/usage.html
https://cloud.google.com/docs/terraform

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