Tooling to migrate config from TFE to TFC.
pip3 install pytfc
export SRC_TFE_HOSTNAME='<my-TFE-hostname>'
export SRC_TFE_TOKEN='<my-TFE-token>'
export SRC_TFE_ORG='<my-TFE-org>'
export DST_TFC_HOSTNAME='app.terraform.io'
export DST_TFC_TOKEN='<my-TFC-token>'
export DST_TFC_ORG='<my-TFC-org>'There are two arguments categories required to run the script:
- Action - What component do you want to migrate?
- Scope - Which Workspaces do you want to migrate (within an Org)?
Actions arguments
--migrate-workspaces- migrate Workspaces and their config (without the State files)--migrate-all-states- migrate all State files--migrate-current-state- migrate the current (latest) State file only
Scope arguments
--workspaces- list of Workspace names separate by spaces (not commas)--all-workspaces- all Workspaces in the Organization
Config File (optional) Some components of Workspaces require a mapping of names or IDs from source to destination in order to be properly migrated, such as:
- VCS OAuth Token ID
- Agent Pool ID
- SSH Key ID
Use the --config-file argument with a path to the JSON file containing the mappings.
See the example template for proper formatting and syntax.
> tfcmig.py --migrate-workspaces --workspaces ws1 ws2 ws3
or with the optional config file:
> tfcmig.py --migrate-workspaces --workspaces ws1 ws2 ws3 --config-file 'tfcmig.json'
> tfcmig.py --migrate-all-states --workspaces ws1 ws2 ws3
- Workspace Team Access - work in progress
- Variable Sets - planned
- Run Triggers - planned
- Run Tasks - unplanned