TF-Associate-004 domain - 8% of the exam

Maintain infrastructure with Terraform

Maintain infrastructure with Terraform is 8% of the HashiCorp Certified: Terraform Associate (TF-Associate-004) exam. These are the objectives it covers, each with practice questions, with every answer explained.

Objectives in this domain

Sample question from this domain

Free sampleMaintain infrastructure with Terraformmedium

A practitioner has applied a configuration that manages roughly forty resources and wants to see the full list of resource addresses currently tracked in state, without printing any attribute values or changing anything. Which command produces exactly this?

  • Aterraform show
  • Bterraform state list Correct
  • Cterraform state show
  • Dterraform plan
Use terraform state list to enumerate the resource addresses tracked in state without printing attribute values. terraform state list walks the state file and emits each managed resource's address, giving an index of what Terraform tracks; it is read-only and outputs no attribute data, which distinguishes it from terraform show.

Why A is wrong: terraform show does read state read-only, but it prints the full human-readable attributes of every resource rather than a bare list of addresses, which is more than was asked for.

Why B is correct: terraform state list reads the current state and prints one resource address per line for every tracked resource, with no attribute values and no modification to state.

Why C is wrong: terraform state show requires a specific resource address argument and prints that one resource's attributes, so it cannot enumerate the whole list of addresses.

Why D is wrong: terraform plan compares configuration against state and refreshes it to compute a diff, so it does extra work and does not simply list the addresses held in state.

Other domains in this exam

See also the TF-Associate-004 cert hub, the study guide, and the cheat sheet.

Examworthy is not affiliated with or endorsed by HashiCorp. Original, blueprint-aligned practice material only.