NS0-403 practice question 13 of 15
You used a Terraform configuration to create a number of resources in Google Cloud for testing your applications. You have completed the tests and you no longer need the infrastructure. You want to delete all of the resources and save costs. In this scenario, which command would you use to satisfy the requirements?
Full set: 60 questionsThe terraform destroy command is used to de-provision and delete all infrastructure resources managed by a specific Terraform configuration. It reads the current state file to identify all created resources and then generates a plan to destroy them. After user confirmation, it proceeds with the deletion, which is ideal for cleaning up temporary environments like the one described in the scenario to prevent ongoing costs.
A. terraform untaint: This command removes the "tainted" status from a resource, preventing it from being destroyed and recreated on the next apply. It does not delete infrastructure.
B. terraform apply: This command creates or updates infrastructure to match the configuration files. It only destroys resources that have been removed from the configuration, not the entire environment.
C. terraform force—unlock: This is a state management command used to manually unlock a state file that was left locked by a failed operation. It does not affect the infrastructure resources.
1. HashiCorp Terraform Documentation, "destroy Command": "The terraform destroy command is a convenient way to destroy all remote objects managed by a particular Terraform configuration." This command is the standard and intended method for tearing down infrastructure.
Source: HashiCorp, Terraform CLI Documentation, destroy command. Available at: https://developer.hashicorp.com/terraform/cli/commands/destroy
2. NetApp Documentation, "Deploy Cloud Volumes ONTAP in Google Cloud": In the section on cleaning up the environment, the official procedure states: "When you no longer need the Cloud Volumes ONTAP system, you should destroy the environment to avoid incurring additional charges... Run the terraform destroy command from the working directory where you have your Terraform files."
Source: NetApp Product Documentation, "Clean up the environment" section. Available at: https://docs.netapp.com/us-en/cloud-manager-automation/taskdeploycvogcpterraform.html#clean-up-the-environment
3. HashiCorp Terraform Documentation, "apply Command": "The terraform apply command executes the actions proposed in a Terraform plan to create, update, or destroy infrastructure." While it can destroy, its primary function is to reconcile the configuration with the deployed state, not to perform a full teardown.
Source: HashiCorp, Terraform CLI Documentation, apply command. Available at: https://developer.hashicorp.com/terraform/cli/commands/apply
Keep practicing
Take the free NS0-403 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other NS0-403 practice questions
- Question 1You want to manage your applications using NetApp Astra Control within your Azure account…
- Question 2What are three version control processes? (Choose three.)
- Question 4A customer wants their main data set to be stored in their primary location while providi…
- Question 5You have a hybrid storage environment with on-premises ONTAP 9.8 clusters and Cloud Volum…
- Question 7You deployed a NetApp Cloud Volumes ONTAP system in your AWS environment and you need to …
- Question 8You are asked to accelerate your company's release cycle by adopting DevOps practices. As…
