Courseiva

TF-004 Implement and maintain state Practice Question

Which three of the following are valid command-line operations that modify the Terraform state? (Choose three.)

⚠ Common exam trap

A common mistake is confusing read-only state inspection commands (like `terraform state list` and `terraform show`) with commands that actually mutate the state file, leading candidates to incorrectly select `terraform plan` as a state-modifying operation.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

`terraform apply -auto-approve`

`terraform apply -auto-approve` modifies the Terraform state by creating, updating, or destroying resources as defined in the configuration, and then writing the resulting state to the state file. The `-auto-approve` flag skips the interactive approval prompt but does not change the fundamental behavior of applying changes and updating state.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    `terraform plan`

    Why it's wrong here

    Read-only operation; does not modify state.

  • ✓

    `terraform apply -auto-approve`

    Why this is correct

    Applies changes and updates state.

  • ✓

    `terraform state rm`

    Why this is correct

    Removes resources from state.

  • ✗

    `terraform state list`

    Why it's wrong here

    Reads state; does not modify it.

  • ✓

    `terraform import`

    Why this is correct

    Imports resources and adds them to state.

About these practice questions

Courseiva writes every TF-004 question from scratch — 434 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.