The terraform state rm commandremovesa resource from Terraform’s state file butdoes not destroythe resource in the actual infrastructure. It only removes Terraform’s knowledge of the resource, meaning Terraform will no longer manage it.
If you run terraform state rm on a resource, Terraform will forget that the resource exists.
However, the resource will still exist in the cloud or infrastructure provider.
If you later run terraform apply, Terraform may try torecreatethe resource because it is no longer present in its state file.
Official Terraform Documentation Reference:
terraform state rm - HashiCorp Documentation
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit