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

Updated On: 7-Feb-2026

What kind of configuration block will create an infrastructure object with settings specified within the block?

  1. provider
  2. state
  3. data
  4. resource

Answer(s): D

Explanation:

This is the kind of configuration block that will create an infrastructure object with settings specified within the block. The other options are not used for creating infrastructure objects, but for configuring providers, accessing state data, or querying data sources.



What is the Terraform style convention for indenting a nesting level compared to the one above it?

  1. With a tab
  2. With two spaces
  3. With four spaces
  4. With three spaces

Answer(s): B

Explanation:

This is the Terraform style convention for indenting a nesting level compared to the one above it. The other options are not consistent with the Terraform style guide.



You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully.
What should you do to delete the newly-created VM with Terraform?

  1. The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
  2. Delete the Terraform state file and execute terraform apply.
  3. The Terraform state file only contains the one new VM. Execute terraform destroy.
  4. Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.

Answer(s): C

Explanation:

This is the best way to delete the newly-created VM with Terraform, as it will only affect the resource that was created by your configuration and state file. The other options are either incorrect or inefficient.



When do changes invoked by terraform apply take effect?

  1. After Terraform has updated the state file
  2. Once the resource provider has fulfilled the request
  3. Immediately
  4. None of the above are correct

Answer(s): B

Explanation:

Changes invoked by terraform apply take effect once the resource provider has fulfilled the request, not after Terraform has updated the state file or immediately. The state file is only a reflection of the real resources, not a source of truth.



What is the workflow for deploying new infrastructure with Terraform?

  1. Write Terraform configuration, run terraform init to initialize the working directory orworkspace, and run terraform apply
  2. Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure
  3. Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly
  4. Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure

Answer(s): A

Explanation:

This is the workflow for deploying new infrastructure with Terraform, as it will create a plan and apply it to the target environment. The other options are either incorrect or incomplete.



Viewing page 9 of 53
Viewing questions 41 - 45 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