Hello,
Terravalet (https://github.com/Pix4D/terravalet) v0.7.0 is out.
We wrote Terravalet to help us restructure our Terraform configuration from one monolith to multiple Terraform root modules.
We wanted a way to move state from one root module to another, without painstakingly having to use “terraform state mv” multiple times by hand.
We also wanted to enable gitops-style operation, by generating a migration script that can be stored in git and reviewed by the team, without doing “hidden” operations.
Terravalet was already able to
- rename resources within the same root module
- move resources from one root module to another
- import multiple resources created out-of-band in one go (instead of painstakingly using terraform import)
This release adds the ability to move resources form one root module to another “against the stream” from a dependency point of view: it allows to overcome the chicken-and-egg problem of having to add “outputs” to the upstream module to allow the downstream module to get its dependencies via remote state and thus being able to terraform plan.
Since we created Terravalet, we are always willing to keep our Terraform code in good shape by splitting a root module and moving resources around, since Terravalet has our back and we have a workflow to validate any change before deploying.
Enjoy!
Marco (and the Pix4D PCI team)