{"repo":"busser/tfautomv","free":true,"listed":false,"github":"https://github.com/busser/tfautomv","clone":"git clone https://github.com/busser/tfautomv.git","description":"Generate Terraform moved blocks automatically for painless refactoring","language":"Go","stars":898,"topics":["move","terraform","block","refactoring","golang","refactor","hacktoberfest"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"tfautomv Generate moved blocks and state move commands automatically for Terraform and OpenTofu. [!NOTE] Status: stable. Used in production. Maintenance is mostly dependency updates: no new features are planned, but bug reports are welcome. Still v0.x because some internals may change in major ways before 1.0. When you rename or move a resource in your Terraform code, Terraform loses track of the resource's state. The next plan shows the original resource being destroyed and a \"new\" one created in its place. tfautomv inspects the plan, detects these create/delete pairs, and writes moved blocks (or terraform state mv commands) so Terraform updates state in place without touching infrastructure. For example, after renaming aws instance.web to aws instance.web server : Running tfautomv produces a moves.tf file: The next terraform plan shows no changes. Installation Homebrew On MacOS or Linux: Shell script On MacOS or Linux: Other methods Yay (Arch Linux), asdf, manual download, from source Yay (Arch Linux): asdf version manager: Manual download: grab a binary from the Releases page and put it in a directory on your PATH . From source (requires Go 1.18+): Then move bin/tfautomv to a directory on your PATH . Contributions to support other installation methods, including Windows for the shell script, are welcome. Usage Run tfautomv in any directory where you would run terraform plan : This runs terraform init , terraform refresh , and terraform plan , then writes moved blocks to a ","default_branch":null,"files":null,"tree":[],"storefront":"/r/busser","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/busser/tfautomv/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}