Introduction
Organizational needs can change, and you may prefer to switch to an airgapped installation depending on your organization's threat model. Note that airgapped is an installation mode that does not use the network to obtain installation dependencies, such as the Terraform Enterprise container images. Airgapped is not an operational mode, meaning that Terraform Enterprise still has dependencies on external networks for operations like Terraform API calls to cloud providers and VCS repository ingress.
This guide provides procedures for converting a Terraform Enterprise instance from an online to an airgapped installation and back.
Prerequisites
Before you begin, you must obtain the necessary installation bundles and back up your current configuration.
-
Download the Installation Bundle: This bundle contains the
install.shscript and the Replicated container images. Replicated is the third-party vendor used to package and deploy Terraform Enterprise. You can download the latest installation bundle from https://install.terraform.io/airgap/latest.tar.gz. This bundle is updated with each new release of Replicated. You can find release notes here: https://release-notes.replicated.com/release-notes/. -
Obtain the Airgap Bundle: This bundle contains the Terraform Enterprise container images. Contact your Customer Success Manager to get a link and password to download the
.airgapfile. This bundle is updated with each new release of Terraform Enterprise, and you will need the latest version to perform future upgrades. -
Back up Configuration: We recommend backing up your current Terraform Enterprise configuration. You can export the settings to a JSON file named
tfe-settings.json.$ replicatedctl app-config export > tfe-settings.json
You can later import this configuration using
$ replicatedctl app-config import < tfe-settings.json.
Procedure
Follow the steps for the conversion you wish to perform.
Option 1: Convert from an Online to an Airgapped Installation
-
Stop the Terraform Enterprise application.
$ replicatedctl app stop
- Download the installation bundle (
latest.tar.gz) to a directory on your instance. -
Navigate to the directory where you downloaded the bundle and extract its contents.
$ tar xf latest.tar.gz
-
Execute the installation script with the
airgapparameter.$ sudo ./install.sh airgap
Note: For an automated installation, you can set the
LicenseBootstrapAirgapPackagePathkey in/etc/replicated.confto the full path of your.airgapfile before running the install script. If you use this method, you can skip the next step. - When you reach the browser-based installer (at port 8800), you will be prompted to provide the path to the airgap bundle (
.airgapfile). After providing the path, the rest of the installation process is the same as the standard online installation. - After the airgapped installation is complete, you may need to restore your Terraform Enterprise and Replicated configurations. If you did not use the automated installation method, you may also need to reconfigure some Replicated settings in the admin console.
-
To restore your configuration from the backup file, run the following commands. The restart ensures that any environment-variable-based configuration options propagate correctly into the Terraform Enterprise containers.
## Import the configuration settings $ replicatedctl app-config import < tfe-settings.json ## Stop the application $ replicatedctl app stop
-
Wait for the application to transition completely. Check the status until the output shows
"IsTransitioning": false.$ replicatedctl app status
-
Start the application to apply the restored configuration.
$ replicatedctl app start
Option 2: Convert from an Airgapped to an Online Installation
- If the
LicenseBootstrapAirgapPackagePathkey is present in the/etc/replicated.conffile, remove it. -
Run the
install.shscript without theairgapparameter.$ sudo ./install.sh
-
After the installation, re-import your settings from the backup file and restart the application.
## Import the configuration settings $ replicatedctl app-config import < tfe-settings.json ## Restart the application to apply changes $ replicatedctl app stop $ replicatedctl app start
- If you did not use the automated installation method, you may also need to reconfigure some Replicated settings in the admin console at port 8800.
Additional Information
For more details on the installation process, refer to the official Terraform Enterprise installation documentation.