Move a tracked object between module addresses.

Section: State Repair

Move module resource

bash
bash
terraform state mv module.old.aws_s3_bucket.logs module.new.aws_s3_bucket.logs
Explanation

Move a tracked object between module addresses.

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 State Repair
Inspect module resource
Inspect one resource nested inside a module.
OpenIn sheetbashsame section
Remove one indexed instance
Remove a single indexed or keyed instance from state.
OpenIn sheetbashsame section
Moved module address snippet
Preserve state when refactoring module paths or names.
OpenIn sheethcl2 tag match
Enable TRACE logs
Turn on maximum logging detail for hard-to-diagnose issues.
OpenIn sheetbash1 tag match
Legacy 0.13 upgrade helper
Legacy helper command that updated provider source declarations in Terraform 0.13.
OpenIn sheetbash1 tag match
Detect and record drift
Refresh state from real infrastructure without proposing config changes.
OpenIn sheetbash1 tag match