tfmigrate
About tfmigrate, please see https://github.com/minamijoyo/tfmigrate .
You can introduce tfmigrate to Terraform Workflow easily with tfaction.
- Create .tfmigrate.hcl and migration file in the working directory
- Create a Pull Request with label
tfmigrate:<target>
tfmigrate plan is run in the pull request CI, and tfmigrate apply is run in the main branch.
The label prefix tfmigrate: can be changed in the configuration file tfaction-root.yaml.
label_prefixes:
tfmigrate: "migrate:"
skip: "skip:"
tfmigrate plan is run.

tfmigrate apply is run.

multi_state migration
If you migrate resources from the target A to the target B using tfmigrate's multi_state.
- Create .tfmigrate.hcl and migration file in the working directory
A - Create a Pull Request with label
tfmigrate:<target A>andskip:<target B>
Or
- Create .tfmigrate.hcl and migration file in the working directory
B - Create a Pull Request with label
tfmigrate:<target B>andskip:<target A>
The label skip:<target> is important to prevent terraform plan and terraform apply from being run.
Scaffold migration pull request
It is a little bothersome to write migration file. You can scaffold migration pull request by GitHub Actions.


💡 Skip creating pull requests
If you don't want to create pull requests by GitHub App, please see Support skipping creating pull requests.