nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #193

When do you need to explicitly execute Terraform in refresh-only mode?

The correct answer is C. Before every terraform import.. Running Terraform in refresh-only mode before terraform import ensures the existing state file accurately reflects real-world infrastructure before you add new resource entries to it. Without this, if the state is stale, importing a resource could create conflicts or produce an i

Submitted by rania.sa· Apr 18, 2026Use Terraform CLI

Question

When do you need to explicitly execute Terraform in refresh-only mode?

Options

  • ABefore every terraform plan.
  • BBefore every terraform apply.
  • CBefore every terraform import.
  • DNone of the above.

How the community answered

(51 responses)
  • A
    2% (1)
  • B
    6% (3)
  • C
    82% (42)
  • D
    10% (5)

Explanation

Running Terraform in refresh-only mode before terraform import ensures the existing state file accurately reflects real-world infrastructure before you add new resource entries to it. Without this, if the state is stale, importing a resource could create conflicts or produce an inaccurate post-import state. terraform plan and terraform apply already perform a refresh internally by default, so explicit refresh-only mode is not required before them.

Topics

#terraform refresh-only#terraform import#terraform cli#state management

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice