Terraform State Mover
Helps refactoring terraform code by offering an interactive prompt for the terraform state mv
command.
Installation
Using homebrew:
brew install mbode/tap/terraform-state-mover
Alternatively, get a pre-built binary from the latest release or build it yourself using
go get github.com/mbode/terraform-state-mover
Usage
terraform-state-mover # inside a Terraform root directory
Extra arguments after a --
are passed to the terraform plan
call. This makes the following possible:
terraform-state-mover -- -var key=value # set variables
terraform-state-mover -- -var-file=variables.tfvars # use variable files
terraform-state-mover -- -refresh=false # skip state refresh
terraform-state-mover -- -parallelism=50 # speed up plan by using more concurrent operations
Hint: If terraform-state-mover is used with the Google Cloud Platform provider and remote state, it is recommended to use --delay=2s
, otherwise API rate limits error might occur.
Key mapping
Key | Action |
β | Select |
β | Next |
β | Previous |
β | Page Down |
β | Page Up |
Demo
Terraform version compatibility
< 0.10.1 | 0.10.1β¦8 | 0.11.0β¦15 | 0.12.0β¦31 | 0.13.0β¦7 | 0.14.0β¦11 | 0.15.0β¦5 | 1.0.0β¦11 | 1.1.0β¦9 | 1.2.0β¦2 |
β | β | β | β | β | β | β | β | β | β |
Contributing
Pull requests are welcome. Please make sure to update tests as appropriate.
License
Similar tools
- tfautomv - Generate Terraform
moved
blocks automatically for painless refactoring