Select the command that doesn't cause Terraform to refresh its state.

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

Select the command that doesn't cause Terraform to refresh its state.

Explanation:
When Terraform refreshes state, it talks to providers to reconcile the real resources with what Terraform believes exists. This is essential for any operation that plans or applies changes, so those commands typically trigger a refresh. A plan usually refreshes by default to compute an accurate set of changes unless you explicitly disable the refresh. An apply refreshes to ensure it acts on the current state and to update the state after applying. A destroy also refreshes to determine what currently exists and should be removed, updating the state accordingly. The command that does not touch the providers is the one that reads directly from the stored state and lists what Terraform already knows about. It does not perform any refresh or provider queries, so it won’t update the state. Thus, the command that doesn’t cause Terraform to refresh its state is the one that lists resources from the local or remote state without contacting providers.

When Terraform refreshes state, it talks to providers to reconcile the real resources with what Terraform believes exists. This is essential for any operation that plans or applies changes, so those commands typically trigger a refresh.

A plan usually refreshes by default to compute an accurate set of changes unless you explicitly disable the refresh. An apply refreshes to ensure it acts on the current state and to update the state after applying. A destroy also refreshes to determine what currently exists and should be removed, updating the state accordingly.

The command that does not touch the providers is the one that reads directly from the stored state and lists what Terraform already knows about. It does not perform any refresh or provider queries, so it won’t update the state.

Thus, the command that doesn’t cause Terraform to refresh its state is the one that lists resources from the local or remote state without contacting providers.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy