Skip to main content

Terraform migrate 1.1 adds VCS workspace support and enhanced GitOps

Terraform migrate 1.1 adds support for VCS workspaces, expanded Git capabilities, and greater control through both the CLI.

Terraform migrate is a command-line tool that simplifies the process of migrating your Terraform state and configuration from Terraform Community Edition to HCP Terraform and Terraform Enterprise. Previously, Terraform migrate supported only CLI-driven Terraform workflows. With the release of Terraform migrate 1.1, you can now create and configure HCP Terraform and Terraform Enterprise workspaces linked to GitHub or GitLab repositories as part of your migration configuration. This enables automated runs via the version control system workflow, which provides stronger alignment with GitOps practices.

This post will share the benefits of this approach and show some examples of Terraform migrate 1.1’s new features in action.

»A GitOps workflow

Infrastructure teams often rely on VCS workflows to manage and trigger infrastructure management with Terraform. With the 1.1 release, Terraform migrate fully embraces GitOps by enabling automated, Git-based migration flows.

Before Terraform migrate 1.1, users had to create a separate migration branch to perform the migration. Now they have the option to configure Terraform migrate to work from their existing repository branches. Using this option, Git token validation, Git operations, and pull-request creation are now more adaptive to user preferences, making the migration experience more seamless.

Here are the specific updates in Terraform migrate 1.1:

»VCS workspace support

You can now define and provision VCS-driven workspaces as part of your migration configuration. These workspaces are linked directly to repositories in GitHub or GitLab and support runs triggered from tracked branches.

As part of this flow:

  • The CLI automatically detects OAuth-connected VCS providers in your HCP Terraform organization.

  • It handles all VCS provider connection scenarios:

    • No connection (prompt to continue with CLI mode)
    • Single connection (auto-selected)
    • Multiple connections (interactive selection via OAuth client ID)

The migration config supports:

  • workspace_mode: Set to either vcs or cli per workspace. This setting is flexible and can be modified by the user after the prepare step.

  • vcs_repo: Includes repository identifier, branch name, OAuth token ID, and submodule settings

  • tfe_working_directory: Specifies the directory to run Terraform from (useful for subfolders in monorepos)

»Git control via provider-level git attributes

Two provider-level attributes give you granular control and help during Git token validation:

  • allow_commit_push: Allows commits and pushes without requiring a migration branch

  • create_pr: Automatically opens a pull request when enabled

»Stability and performance improvements

There were two major stability and performance enhancements in Terraform migrate 1.1:

  • Token validation optimization: Token checks now only occur when Git operations are enabled via allow_commit_push and create_pr, improving speed and reducing false errors in the execution step.

  • Reliable branch push: Branches are now reliably pushed with detailed error feedback. The migration branch is automatically pushed to the repository after the creation.

»Next steps

You can find installation, setup instructions, and configuration examples in the Terraform migrate overview page.

This release represents a major step forward in our mission to deliver powerful tools for managing infrastructure as code. We invite you to try Terraform migrate and discover how it streamlines and simplifies your migration to HCP Terraform or Terraform Enterprise. Explore the advantages of HCP Terraform by signing up here.

Sign up for the latest HashiCorp news

By submitting this form, you acknowledge and agree that HashiCorp will process your personal information in accordance with the Privacy Policy.