Removing Items from Terraform State
Learn how to use the rm subcommand in Terraform.
We'll cover the following...
We'll cover the following...
The rm subcommand
The terraform state rm command is used to remove items from the Terraform state.
Syntax
The rm subcommand has the following syntax: terraform state rm [options] ADDRESS.
Use of the terraform state rm command
We can use this command to remove a single resource, a single instance of a resource, entire modules, and more. The resources removed by the command are removed from the state file but aren’t destroyed in the target environment.
The most common use for the rm command is to remove a resource from Terraform management. ...