The terraform.tfstate file always matches your currently built infrastructure.

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

The terraform.tfstate file always matches your currently built infrastructure.

Explanation:
Terraform’s state file is a snapshot of what Terraform currently knows and has last applied, not a live mirror of every resource in the real world. If someone changes infrastructure outside Terraform, or if you later run plan with refreshing disabled, the real deployed resources can drift from what the state file shows. The state is updated when you apply changes, and plan typically refreshes state to detect drift, but you can disable that behavior with specific flags or commands. Because of these possibilities for drift and for optional refreshing, the state file does not always match the currently built infrastructure.

Terraform’s state file is a snapshot of what Terraform currently knows and has last applied, not a live mirror of every resource in the real world. If someone changes infrastructure outside Terraform, or if you later run plan with refreshing disabled, the real deployed resources can drift from what the state file shows. The state is updated when you apply changes, and plan typically refreshes state to detect drift, but you can disable that behavior with specific flags or commands. Because of these possibilities for drift and for optional refreshing, the state file does not always match the currently built infrastructure.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy