All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v0.8.0 - (2024-01-31)
- New command
remove
to remove resources from the Terraform state. See the README for details. - The script generated by
terravalet import
now prints each command before executing it. This helps to understand which command is being executed.
- Use Go 1.21
v0.7.2 - (2023-02-28)
- import: don't break the loop if a resource is not defined
v0.7.1 - (2023-02-21)
- import: use quote formatting verb to allow for multi-word resource addresses
v0.7.0 - (2022-02-08)
-
New command
move-before
, to move resources to a root environment upstream in the dependency chain (see README for details):$ terravalet move-before -h Usage: terravalet move-before --script SCRIPT --before BEFORE --after AFTER Options: --script SCRIPT the migration scripts; will generate SCRIPT_up.sh and SCRIPT_down.sh --before BEFORE the before root directory; will look for BEFORE.tfplan and BEFORE.tfstate --after AFTER the after root directory; will look for AFTER.tfstate
-
Simplify workflow for state move (see README for details).
- Rename command
move
tomove-after
(to be uniform with the new commandmove-before
). - Command
move-after
now takes 3 (different) CLI options instead of the previous 6:$ terravalet move-after -h Usage: terravalet move-after --script SCRIPT --before BEFORE --after AFTER Options: --script SCRIPT the migration scripts; will generate SCRIPT_up.sh and SCRIPT_down.sh --before BEFORE the before root directory; will look for BEFORE.tfplan and BEFORE.tfstate --after AFTER the after root directory; will look for BEFORE.tfstate and AFTER.tfstate
- Command-line parsing: replace flaggy with go-arg.
- Fix a test flake due to the use of unsorted set (i.e {abcde} -> {abdcde} or {abdecde} -> {abdcde})
v0.6.1 - (2021-08-24)
- Update Go to 1.17
- Fix breaking too early the loop giving a not fully compiled script.
v0.6.0 - (2021-08-11)
- Subcommand
import
(new functionality):import - Import resources generated out-of-band of Terraform Flags: -res-defs Path to resources definitions -src-plan Path to the SRC terraform plan in json format -up Path to the resources import script to generate (import.up.sh). -down Path to the resources remove script to generate (import.down.sh).
v0.5.0 - (2021-07-23)
- Improved Fuzzy matching selection algorithm to iteratively consume the best matching create/destroy combination.
v0.4.0 - (2021-01-25)
- Due to the introduction of subcommands, the CLI API has changed; now it must be invoked by specifying a subcommand. See section New for details.
- Introduction of subcommands.
- Subcommand
rename
(existing functionality):rename - Rename resources in the same tf root environment Flags: -plan Path to the terraform plan. -fuzzy-match Enable q-gram distance fuzzy matching. -up Path to the up migration script to generate -down Path to the down migration script to generate
- Subcommand
move
(new functionality):move - Move resources from one root environment to another Flags: -src-plan Path to the SRC terraform plan -dst-plan Path to the DST terraform plan -src-state Path to the SRC local state to modify -dst-state Path to the DST local state to modify -up Path to the up migration script to generate -down Path to the down migration script to generate
v0.3.0 - (2020-12-11)
- Fuzzy matching. See README for more information.
v0.2.0 - (2020-11-27)
- The CLI API has changed; now it must be invoked as
$ terravalet -plan=PLAN -up=UP.sh -down=DOWN.sh
- Migration script: do not print anymore the count
>>> 1/N
, because each time N changed, this was causing N spurious diffs, hiding the real elements that changed. Theterravalet_output_format
is now 2. - Migration script: do not take a lock; it is useless as long as the operations are strictly on a local state file. This speeds up the runtime.
- Generate also the DOWN migration script.
- Extensive tests.
v0.1.0 - (2020-11-20)
- For the time being, this repository is kept private. Will be open-sourced later.
- First release, with scripted release support.
- Basic functionalities, generate the UP migration script only.
- CLI API:
$ terravalet -plan=PLAN > UP.sh
- flag
-version
reports the git commit.