Terraform-Associate-004 practice question 4 of 35
Using the terraform state rm command against a resource will destroy it.
Full set: 360 questionsThe terraform state rm command removes the record of a resource from the Terraform state file. This action does not destroy the actual, real-world infrastructure object. It simply tells Terraform to no longer manage that resource. The resource will continue to exist in the cloud provider's environment, but it becomes "orphaned" from the Terraform configuration that created it. To destroy the infrastructure itself, you must use the terraform destroy command.
The statement is false because it incorrectly equates state file manipulation with infrastructure lifecycle management. The terraform state subcommand family is designed for advanced state manipulation, which is separate from the standard plan/apply/destroy workflow that affects real resources.
1. HashiCorp Terraform Documentation, "Command: state rm": The official documentation explicitly states, "This does not destroy the infrastructure represented by the item, but it does remove the binding from the state. If you want to destroy the item, use terraform destroy instead." This directly refutes the premise of the question.
Source: HashiCorp Terraform CLI Documentation, developer.hashicorp.com/terraform/cli/commands/state/rm
2. HashiCorp Learn, "Manage Resources in Terraform State": This official tutorial provides a practical example and clarifies the command's purpose. In the section "Remove a resource from Terraform state," it guides the user to run terraform state rm and then confirms, "Terraform no longer manages this S3 bucket, but the bucket still exists in your AWS account."
Source: HashiCorp Learn, developer.hashicorp.com/terraform/tutorials/state/state-rm
Keep practicing
Take the free Terraform-Associate-004 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Terraform-Associate-004 practice questions
- Question 1You should run terraform fnt to rewrite all Terraform configurations within the current w…
- Question 2Module variable assignments are inherited from the parent module and you do not need to e…
- Question 3terraform validate confirms thesyntaxof Terraform files.
- Question 5Variables declared within a module are accessible outside of the module.
- Question 6terraform init retrieves and caches the configuration for all remote modules.
- Question 7terraform validate uses provider APIs to verify your infrastructure settings.
