Free Terraform Associate 004 Exam Braindumps
Terraform Associate 004 Questions 91–95 (page: 20)

Updated On: 10-Feb-2026

What is a key benefit of the Terraform state file?

  1. A state file can schedule recurring infrastructure tasks
  2. A state file is a source of truth for resources provisioned with Terraform
  3. A state file is a source of truth for resources provisioned with a public cloud console
  4. A state file is the desired state expressed by the Terraform code files

Answer(s): B

Explanation:

This is a key benefit of the Terraform state file, as it stores and tracks the metadata and attributes of the resources that are managed by Terraform, and allows Terraform to compare the current state with the desired state expressed by your configuration files.



You have to initialize a Terraform backend before it can be configured.

  1. True
  2. False

Answer(s): B

Explanation:

You can configure a backend in your Terraform code before initializing it. Initializing a backend will store the state file remotely and enable features like locking and workspaces. Reference = [Terraform Backends]



You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database.
What is the best way to achieve this using Terraform?

  1. Use the terraform state rm command to remove the VM from state file
  2. Use the terraform taint command targeting the VMs then run terraform plan and terraform apply
  3. Use the terraform apply command targeting the VM resources only
  4. Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply

Answer(s): B

Explanation:

The terraform taint command marks a resource as tainted, which means it will be destroyed and recreated on the next apply. This way, you can replace the VM instance without affecting the database or other resources. Reference = [Terraform Taint]



How would you output returned values from a child module in the Terraform CLI output?

  1. Declare the output in the root configuration
  2. Declare the output in the child module
  3. Declare the output in both the root and child module
  4. None of the above

Answer(s): C

Explanation:

To output returned values from a child module in the Terraform CLI output, you need to declare the output in both the child module and the root module. The child module output will return the value to the root module, and the root module output will display the value in the CLI. Reference = [Terraform Outputs]



If a module declares a variable with a default, that variable must also be defined within the module.

  1. True
  2. False

Answer(s): B

Explanation:

A module can declare a variable with a default value without requiring the caller to define it. This allows the module to provide a sensible default behavior that can be customized by the caller if needed. Reference = [Module Variables]



Viewing page 20 of 53
Viewing questions 96 - 100 out of 147 questions


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

AI Tutor AI Tutor 👋 I’m here to help!