/terraform-state-mover

Fork only for PRs - Refactoring Terraform code has never been easier.

Primary LanguageGoMIT LicenseMIT

Go Report Card Actions Status License

Terraform State Mover

Helps refactoring terraform code by offering an interactive prompt for the terraform state mv command.

Installation

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  # setting variables
terraform-state-mover -- -var-file=variables.tfvars  # using variable files

Demo

Terraform version compatibility

< 0.10.1 0.10.1…8 0.11.0…14 0.12.0…26

Contributing

Pull requests are welcome. Please make sure to update tests as appropriate.

License

MIT