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

Updated On: 7-Feb-2026

What does Terraform use the .terraform.lock.hc1 file for?

  1. There is no such file
  2. Tracking specific provider dependencies
  3. Preventing Terraform runs from occurring
  4. Storing references to workspaces which are locked

Answer(s): B

Explanation:

The .terraform.lock.hcl file is a new feature in Terraform 0.14 that records the exact versions of each provider used in your configuration. This helps ensure consistent and reproducible behavior across different machines and runs.



Why does this backend configuration not follow best practices?

  1. An alias meta-argument should be included in backend blocks whenever possible
  2. You should use the local enhanced storage backend whenever possible
  3. You should not store credentials in Terraform configuration
  4. The backend configuration should contain multiple credentials so that more than one user can execute terraform plan and terraform apply

Answer(s): C

Explanation:

This is a bad practice, as it exposes your credentials to anyone who can access your configuration files or state files. You should use environment variables, credential files, or other mechanisms to provide credentials to Terraform.



Module variable assignments are inherited from the parent module and you do not need to explicitly set them.

  1. True
  2. False

Answer(s): B

Explanation:

Module variable assignments are not inherited from the parent module and you need to explicitly set them using the source argument. This allows you to customize the behavior of each module instance.



What does Terraform not reference when running a terraform apply -refresh-only ?

  1. State file
  2. Credentials
  3. Cloud provider
  4. Terraform resource definitions in configuration files

Answer(s): D

Explanation:

When running a terraform apply -refresh-only, Terraform does not reference the configuration files, but only the state file, credentials, and cloud provider. The purpose of this command is to update the state file with the current status of the real resources, without making any changes to them1.



Which of the following is not a valid Terraform variable type?

  1. list
  2. array
  3. nap
  4. string

Answer(s): B

Explanation:

This is not a valid Terraform variable type. The other options are valid variable types that can store different kinds of values2.



Viewing page 6 of 53
Viewing questions 26 - 30 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