TA-002-P · Question #372
Using the terraform state rm command against a resource will destroy it.
The correct answer is B. False. The terraform state rm command removes a resource's record from the Terraform state file, but it does not destroy the actual infrastructure resource in the cloud provider.
Question
Using the terraform state rm command against a resource will destroy it.
Options
- ATrue
- BFalse
How the community answered
(65 responses)- A11% (7)
- B89% (58)
Why each option
The terraform state rm command removes a resource's record from the Terraform state file, but it does not destroy the actual infrastructure resource in the cloud provider.
This statement is false because terraform state rm only modifies the state file, not the deployed infrastructure.
The terraform state rm command is used to remove an item from the Terraform state file. It only de-associates Terraform's management from that resource, meaning Terraform will no longer track or manage it, but the actual resource in the cloud or on-premise environment remains intact.
Concept tested: Terraform state management - terraform state rm
Source: https://developer.hashicorp.com/terraform/cli/commands/state/rm
Topics
Community Discussion
No community discussion yet for this question.