HashiCorp Terraform Associate Exam (page: 2)
HashiCorp Certified: Terraform Associate
Updated on: 25-Dec-2025

You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you need to rerun the script.
Which of the following commands would you use first?

  1. terraform taint null_resource.run_script
  2. terraform apply -target=null_resource.run_script
  3. terraform validate null_resource.run_script
  4. terraform plan -target=null_resource.run_script

Answer(s): A



Which provisioner invokes a process on the resource created by Terraform?

  1. remote-exec
  2. null-exec
  3. local-exec
  4. file

Answer(s): A

Explanation:

The remote-exec provisioner invokes a script on a remote resource after it is created.


Reference:

https://www.terraform.io/docs/language/resources/provisioners/remote-exec.html



Which of the following is not true of Terraform providers?

  1. Providers can be written by individuals
  2. Providers can be maintained by a community of users
  3. Some providers are maintained by HashiCorp
  4. Major cloud vendors and non-cloud vendors can write, maintain, or collaborate on Terraform providers
  5. None of the above

Answer(s): E

Explanation:


Reference:

https://jayendrapatil.com/terraform-cheat-sheet/#Terraform_Read_and_write_configuration



What command does Terraform require the first time you run it within a configuration directory?

  1. terraform import
  2. terraform init
  3. terraform plan
  4. terraform workspace

Answer(s): B

Explanation:

terraform init command is used to initialize a working directory containing Terraform configuration files.


Reference:

https://www.terraform.io/docs/cli/commands/init.html



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. Run terraform output ip_address to view the result
  2. 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
  3. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
  4. Run terraform destroy then terraform apply and look for the IP address in stdout

Answer(s): C

Explanation:


Reference:

https://www.terraform.io/docs/cli/commands/output.html



Viewing Page 2 of 71



Share your comments for HashiCorp Terraform Associate exam with other users:

DN 9/4/2023 11:19:00 PM

question 14 - run terraform import: this is the recommended best practice for bringing manually created or destroyed resources under terraform management. you use terraform import to associate an existing resource with a terraform resource configuration. this ensures that terraform is aware of the resource, and you can subsequently manage it with terraform.
Anonymous


YK 12/11/2023 1:10:00 AM

good one nice
JAPAN


Mn8300 11/9/2023 8:53:00 AM

nice questions
Anonymous