Stop tracking a resource without destroying the remote object.

Section: Import, Move, Remove

Remove resource from state

bash
bash
terraform state rm aws_instance.web
Explanation

Stop tracking a resource without destroying the remote object.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Import, Move, Remove
Import existing object
Associate an existing infrastructure object with a resource address in state.
OpenIn sheetbashsame section
Move state address
Rename or move a resource address in state.
OpenIn sheetbashsame section
Replace provider source in state
Update provider source addresses recorded in state.
OpenIn sheetbashsame section
Import with config generation
Generate configuration while importing supported resources.
OpenIn sheetbashsame section
Pull raw state JSON
Download the latest state and write it to a local file.
OpenIn sheetbash2 tag match
Plan with alternate state path
Use a non-default local state path for commands that support it.
OpenIn sheetbash2 tag match