padok-team / tfautomv

Generate Terraform moved blocks automatically for painless refactoring

Home Page:https://tfautomv.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic Terraform moved blocks

License Go Report Card tests-passing

When refactoring a Terraform codebase, you often need to write moved blocks. This can be tedious. Let tfautomv do it for you.

Why does this exist?

When you move a resource in your code, Terraform loses track of the resource's state. The next time you run Terraform, it will plan to delete the resource it has memory of and create the "new" resource it found in your refactored code.

tfautomv inspects the output of terraform plan, detects such creation/deletion pairs and writes a moved block so that Terraform now knows no deletion or creation is required.

Demo

This demo illustrates tfautomv's core features:

  • Generating moved blocks automatically for refactored code
  • Optionally doing a dry run
  • Optionally showing a detailed analysis

demo

Installation

See Getting started / Installation for instructions.

Usage

See Getting started / Tutorial for a hands-on guided introduction de tfautomv.

See Usage for a list of tfautomv's features.

The following versions of Terraform are supported:

  • 1.1.x and above by default
  • 0.13.x and above when using the -output=commands flag

How it works

See Design for details on how tfautomv works under the hood.

License

The code is licensed under the permissive Apache v2.0 license. Read this for a summary.

About

Generate Terraform moved blocks automatically for painless refactoring

https://tfautomv.dev

License:Apache License 2.0


Languages

Language:Go 86.2%Language:Shell 12.8%Language:Makefile 1.0%