Using the terraform state rm command against a resource will destroy it.

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

Using the terraform state rm command against a resource will destroy it.

Explanation:
The thing being tested is what state management commands do versus what actually happens in infrastructure. Removing a resource from Terraform’s state untracks it; it edits the state file so Terraform no longer manages that resource. It does not issue any API call to delete the real resource. So the underlying resource continues to exist in your cloud or environment unless you destroy it separately. That’s why the statement is false: state rm stops managing the resource, but it does not destroy it. If you want the resource gone, you’d need to destroy it while Terraform still tracks it (or delete it manually) and then, if needed, re-import or recreate as appropriate.

The thing being tested is what state management commands do versus what actually happens in infrastructure. Removing a resource from Terraform’s state untracks it; it edits the state file so Terraform no longer manages that resource. It does not issue any API call to delete the real resource. So the underlying resource continues to exist in your cloud or environment unless you destroy it separately. That’s why the statement is false: state rm stops managing the resource, but it does not destroy it. If you want the resource gone, you’d need to destroy it while Terraform still tracks it (or delete it manually) and then, if needed, re-import or recreate as appropriate.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy