Terraform
- Terraform Enterprise
- 1.0.x
- v202507-1
- v202506-1
- v202505-1
- v202504-1
- v202503-1
- v202502-2
- v202502-1
- v202501-1
- v202411-2
- v202411-1
- v202410-1
- v202409-3
- v202409-2
- v202409-1
- v202408-1
- No versions of this document exist before v202408-1. Click below to redirect to the version homepage.
- v202407-1
- v202406-1
- v202405-1
- v202404-2
- v202404-1
- v202402-2
- v202402-1
- v202401-2
- v202401-1
- v202312-1
- v202311-1
- v202310-1
- v202309-1
- v202308-1
- v202307-1
- v202306-1
- v202305-2
- v202305-1
- v202304-1
- v202303-1
- v202302-1
- v202301-2
- v202301-1
- v202212-2
- v202212-1
- v202211-1
- v202210-1
- v202209-2
- v202209-1
- v202208-3
- v202208-2
- v202208-1
- v202207-2
- v202207-1
- v202206-1
Upgrade Terraform Enterprise
This topic describes how to upgrade Terraform Enterprise installations.
Introduction
To upgrade Terraform Enterprise, follow the checklist for every environment, from test through production, and for each intermediate release that needs to be applied.
Select a target version
Complete the following tasks before you schedule downtime:
- Confirm compatibility: Identify the Terraform Enterprise version you plan to install. Compare the supported platforms and dependency versions in the release tables with your current infrastructure. Review the release notes for the target version and every intermediate version for breaking changes, deprecations, and new requirements.
- Map required releases: Use the "Last required release" marker on the target version page (for example, Terraform Enterprise 1.1.x) to determine which previous releases you must install first. Repeat this comparison for each required release until you reach your current running version. Document the sequence so you can stage artifacts for every intermediate release. See the Example upgrade path for a sample workflow.
- Stage release artifacts: Download the Terraform Enterprise container images for every release in your upgrade path. Import the images into internal registries or hosts that cannot reach the public registry so you can update configuration files without extending downtime. Prune unused local images or volumes to free capacity where needed.
- Prepare the maintenance window: Freeze automation that could start runs, notify stakeholders about the planned downtime, and document the rollback criteria you intend to follow if validation fails.
Example upgrade path
The following scenario shows how to build an upgrade path from a monthly release to a milestone release:
- Your production environment runs Terraform Enterprise
v202401-1. - Your target version is Terraform Enterprise
1.1.0. - Visit the Terraform Enterprise 1.1.x releases page and note that
1.1.0listsv202406-1as the last required release. - Visit the Terraform Enterprise 2024 releases page.
v202406-1requires no earlier release, so your full upgrade sequence isv202401-1→v202406-1→1.1.0. - Stage the images and release notes for each intermediate release. Use the planning checklist at the beginning of this topic to coordinate backups, notifications, and testing before you promote the upgrade to production.
Take Terraform Enterprise offline
Perform the following tasks to pause workloads before you capture backups and apply the upgrade. Review the runtime-specific instructions in the tabs when you stop the application.
Use the Terraform Enterprise CLI to stop any existing Terraform runs and prevent Terraform Enterprise from starting new operations. Draining nodes allows active runs to complete before blocking new work. Refer to Gracefully stop work on a node for instructions.
If your deployment runs multiple
terraform-enterprisenodes in active-active mode, scale down to a single node to ensure upgrade consistency. Refer to Configure the operational mode for information about operational modes.If your deployment uses an autoscaling group to manage instances of Terraform Enterprise, disable any configured health checks that would trigger the autoscaling group to rotate Terraform Enterprise instances during an upgrade.
Stop the Terraform Enterprise application.
Stop all running containers:
$ docker compose down
Back up Terraform Enterprise
Run backups while Terraform Enterprise remains offline so you capture a consistent state:
- Snapshot external services, including PostgreSQL, object storage, and Redis.
- Export application configuration files and environment variables that you may need during rollback.
- Verify that the backups are valid and stored in a location that you can access quickly if you must revert the upgrade.
Refer to Backup and restore for detailed backup procedures.
Apply the upgrade
After you capture backups, apply the target release. Use the artifacts you staged during planning so you can complete these steps within the maintenance window.
Update your configuration to reference the staged Terraform Enterprise image for the target release:
images.releases.hashicorp.com/hashicorp/terraform-enterprise:x.y.z.Update the image tag in your
compose.yamlfile:name: terraform-enterprise services: tfe: image: images.releases.hashicorp.com/hashicorp/terraform-enterprise:<vYYYYMM-#>Start the Terraform Enterprise application with the new image. Database migrations run automatically during startup and may take considerable time depending on your deployment size and the migrations required for the target release. The application remains unavailable until migrations finish.
Start the containers with the updated image:
$ docker compose up --detachIf you performed the upgrade in a test environment, repeat this section for the production instance of Terraform Enterprise after you validate results.
Validate the upgrade
After Terraform Enterprise starts on the new version, perform the following checks:
Verify startup checks passed. Use the Terraform Enterprise CLI to trigger and review startup checks. Refer to Trigger startup checks for instructions on running the checks and Startup checks reference for details about each check and common failure scenarios.
Check application health. Query the health check endpoint to verify the application responds correctly. The endpoint returns
200 OKwhen Terraform Enterprise operates normally. Refer to Perform diagnostics for additional information about the health check endpoint.$ curl https://<TFE_HOSTNAME>/_health_checkPerform a test run. Execute a test Terraform plan and apply in a non-production workspace to confirm core functionality.
Verify release-specific features. Confirm that features or fixes from the target release appear as expected. Consult the release notes for validation steps.
Re-enable paused systems. Restore automation, autoscaling configurations, and monitoring that you paused during the upgrade. For active-active deployments, scale back to your desired replica count.
Document the upgrade. Record the upgrade path, any issues encountered, and resolution steps for future reference.
Troubleshoot validation failures
If any validation step fails or the application does not stabilize:
- Pause automated traffic and notify stakeholders.
- Review application logs for migration errors or dependency mismatches. Refer to Access the Terraform Enterprise CLI for instructions on accessing logs in your environment. You can also download logs through the Admin Console or the System API.
- If the issue persists beyond your change window, initiate rollback:
- Stop the Terraform Enterprise application.
- Restore PostgreSQL from the pre-upgrade snapshot.
- Restore object storage from the pre-upgrade snapshot.
- Deploy the previous Terraform Enterprise image version.
- Verify the application starts successfully.
- Contact HashiCorp Support with collected logs, the upgrade path attempted, and error messages for assistance.
If you encounter issues at any point, contact HashiCorp Support with your upgrade plan, release sequence, and the relevant logs.