Terraform
Configure the operational mode
This topic describes how to specify the operational mode for your Terraform Enterprise deployment.
Introduction
The operational mode determines where Terraform Enterprise stores and retrieves data, which can impact your backup and restore procedures, disaster recovery procedures, and scaling options. The operational mode is required to deploy Terraform Enterprise for all runtimes except Kubernetes. Refer to Data storage settings overview for additional information.
Recommended modes
Use the following guidelines to help you choose the appropriate mode.
active-active
Set TFE_OPERATIONAL_MODE
to active-active
under the following conditions:
- Your environment has an external PostgreSQL server, S3-compatible object storage, and Redis instance.
- You have experience managing a PostgreSQL server, such as Amazon RDS for PostgreSQL, Google Cloud SQL for PostgreSQL, or Azure Database for PostgreSQL.
- You have experience managing an S3-compatible object storage location, such as AWS S3, Azure Blob Storage, Google Cloud Storage, or MinIO.
- You have experience managing a Redis instance, such as AWS ElastiCache for Redis, Azure Cache for Redis, or Google Cloud Memorystore for Redis.
- You want to use native backup and restore features provided by the external PostgreSQL server and S3-compatible object storage.
- You want to scale beyond a single instance of Terraform Enterprise to increase reliability and performance.
external
Set TFE_OPERATIONAL_MODE
to external
under the following conditions:
- Your environment has an external PostgreSQL server, S3-compatible object storage, and Redis instance.
- You have experience managing a PostgreSQL server, such as Amazon RDS for PostgreSQL, Google Cloud SQL for PostgreSQL, or Azure Database for PostgreSQL.
- You have experience managing an S3-compatible object storage location, such as AWS S3, Azure Blob Storage, Google Cloud Storage, or MinIO.
- You have experience managing a Redis instance, such as AWS ElastiCache for Redis, Azure Cache for Redis, or Google Cloud Memorystore for Redis.
- You want to use native backup and restore features provided by the external PostgreSQL server and S3-compatible object storage.
- You want to scale beyond a single instance of Terraform Enterprise to increase reliability and performance.
disk
Set TFE_OPERATIONAL_MODE
to disk
under the following conditions:
- Your environment does not have an external PostgreSQL server or S3-compatible object storage.
- You have experience managing persistent storage, such as an AWS EBS volume, an Azure Managed Disk, a Google Cloud Persistent Disk, or an iSCSI location.
- You are familiar with using command line tools, such as
cp
,scp
, andrsync
, to backup and restore data.
Requirements
The requirements depend on which operational mode you choose.
external
mode
- Refer to the PostgreSQL configuration requirements for stateful application data storage requirement details.
- Refer to the data object storage configuration requirements for requirements.
active-active
mode
- Refer to the PostgreSQL configuration requirements for stateful application data storage requirement details.
- Refer to the data object storage configuration requirements for requirements.
- Refer to the Redis data store configuration requirements for requirements.
disk
mode
One of the following mounted disk types is required for the persistent storage volume:
- AWS EBS
- GCP zonal persistent disk
- Azure disk storage
- iSCSI
- SAN
- A disk physically connected to the host machine
Specify operational mode
Add the TFE_OPERATIONAL_MODE
variable to your Terraform Enterprise configuration and specify a mode. The following example sets the mode to external
when deploying to Docker:
name: terraform-enterprise
services:
tfe:
image: images.releases.hashicorp.com/hashicorp/terraform-enterprise:<vYYYYMM-#>
environment:
TFE_OPERATIONAL_MODE: "external"
Refer to the TFE_OPERATIONAL_MODE
configuration reference for details about operational mode settings.