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

Updated On: 7-Feb-2026

You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.



Which command will migrate your current state file to the new S3 remote backend?

  1. terraform state
  2. terraform init
  3. terraform push
  4. terraform refresh

Answer(s): B

Explanation:

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



Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to store the state file in a central location.
Which of the following backends would not work?

  1. Artifactory
  2. Amazon S3
  3. Terraform Cloud
  4. Git

Answer(s): D

Explanation:

This is not a valid backend for Terraform, as it does not support locking or versioning of state files4. The other options are valid backends that can store state files in a central location.



You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code.
What is the best method to quickly find the IP address of the resource you deployed?

  1. In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file
  2. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
  3. Run terraform output ip_address to view the result
  4. Run terraform destroy then terraform apply and look for the IP address in stdout

Answer(s): B

Explanation:

This is a quick way to inspect the state file and find the information you need without modifying anything5. The other options are either incorrect or inefficient.



As a developer, you want to ensure your plugins are up to date with the latest versions.
Which Terraform command should you use?

  1. terraform refresh -upgrade
  2. terraform apply -upgrade
  3. terraform init -upgrade
  4. terraform providers -upgrade

Answer(s): C

Explanation:

This command will upgrade the plugins to the latest acceptable version within the version constraints specified in the configuration. The other commands do not have an -upgrade option.



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

  1. Required input variables
  2. Optional inputs variables and default values
  3. Outputs
  4. All of the above
  5. None of the above

Answer(s): D

Explanation:

The public Terraform Module Registry automatically exposes all the information about published modules, including required input variables, optional input variables and default values, and outputs. This helps users to understand how to use and configure the modules.



Viewing page 7 of 53
Viewing questions 31 - 35 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