HashiCorp Terraform-Associate-004 Exam
HashiCorp Certified: Terraform Associate (004) (Page 4 )

Updated On: 7-Feb-2026

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

  1. State locking
  2. Version control
  3. Provider constraints
  4. Remote backends

Answer(s): 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.



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

  1. chomp
  2. join
  3. slice
  4. split

Answer(s): 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)



What does the default "local" Terraform backend store?

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

Answer(s): 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.



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

  1. Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces
  2. Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
  3. Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
  4. Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces

Answer(s): 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.



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?

  1. Copy the sensitive variables into your Terraform code
  2. Store the sensitive variables in a secure_varS.tf file
  3. Store the sensitive variables as plain text in a source code repository
  4. Pass variables to Terraform with a -var flag

Answer(s): 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.



Viewing page 4 of 53
Viewing questions 16 - 20 out of 259 questions



Post your Comments and Discuss HashiCorp Terraform-Associate-004 exam prep with other Community members:

Join the Terraform-Associate-004 Discussion