Use moved blocks to preserve state during resource renames in configuration.

Section: Dependency and Refactoring Patterns

Moved block snippet

hcl
hcl
moved {
  from = aws_instance.old
  to   = aws_instance.web
}
Explanation

Use moved blocks to preserve state during resource renames in configuration.

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 Dependency and Refactoring Patterns
Removed block snippet
Document intentional removal of resource addresses when refactoring.
OpenIn sheethclsame section
Install/update remote modules
Download and update remote module sources.
OpenIn sheetbash1 tag match
Generate provider lock info for platform
Update the dependency lock file with checksums for target platforms.
OpenIn sheetbash1 tag match
README module example pattern
Example of documenting reusable module outputs clearly.
OpenIn sheethcl1 tag match
Init from module source
Copy a module into an empty working directory and initialize it.
OpenIn sheetbash1 tag match
Mirror providers locally
Download required providers into a local mirror directory.
OpenIn sheetbash1 tag match