What is terraform refresh intended to detect?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

What is terraform refresh intended to detect?

Explanation:
The main concept is drift between what Terraform has recorded in its state and what actually exists in the real infrastructure. Terraform refresh updates the state by querying the provider APIs for the current attributes of each managed resource and rewriting the state file to match reality. This makes it possible to see if resources were changed outside Terraform, which is what we call drift. It’s not about detecting changes in the Terraform configuration itself (that’s what a plan does). It also isn’t specifically about checking for an empty or corrupt state file; its purpose is to reconcile the state with real-world resources so subsequent plans reflect the true situation.

The main concept is drift between what Terraform has recorded in its state and what actually exists in the real infrastructure. Terraform refresh updates the state by querying the provider APIs for the current attributes of each managed resource and rewriting the state file to match reality. This makes it possible to see if resources were changed outside Terraform, which is what we call drift. It’s not about detecting changes in the Terraform configuration itself (that’s what a plan does). It also isn’t specifically about checking for an empty or corrupt state file; its purpose is to reconcile the state with real-world resources so subsequent plans reflect the true situation.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy