Terraform destroy is the only way to remove infrastructure.

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

Terraform destroy is the only way to remove infrastructure.

Explanation:
Terraform manages infrastructure lifecycle by comparing the desired state defined in your configuration with the actual state recorded in the state file. Because of this, removing resources doesn’t have to mean running a blanket destroy every time. If you delete a resource block from your configuration (or set its count to zero) and then apply, Terraform will destroy those resources to bring the real world in line with the updated configuration. This is a common and controlled way to decommission specific resources or an entire environment without wiping everything at once. You can also target a particular resource for destruction if you need fine-grained removal. Deleting resources outside Terraform can create drift, leaving Terraform unaware of the real state. In that case, you’d need to reconcile the state (for example, by refreshing or removing the resource from state) to avoid inconsistencies. So, destroying everything with a single command is not the only way to remove infrastructure—changing the configuration and applying is often the proper workflow.

Terraform manages infrastructure lifecycle by comparing the desired state defined in your configuration with the actual state recorded in the state file. Because of this, removing resources doesn’t have to mean running a blanket destroy every time.

If you delete a resource block from your configuration (or set its count to zero) and then apply, Terraform will destroy those resources to bring the real world in line with the updated configuration. This is a common and controlled way to decommission specific resources or an entire environment without wiping everything at once. You can also target a particular resource for destruction if you need fine-grained removal.

Deleting resources outside Terraform can create drift, leaving Terraform unaware of the real state. In that case, you’d need to reconcile the state (for example, by refreshing or removing the resource from state) to avoid inconsistencies.

So, destroying everything with a single command is not the only way to remove infrastructure—changing the configuration and applying is often the proper workflow.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy