Terraform
Terraform Enterprise Operational Modes
You must choose an operational mode before you install and deploy Terraform Enterprise. The operation mode determines where Terraform Enterprise stores its data. Where you store Terraform Enterprise data can impact your backup and restore procedures, disaster recovery procedures, and scaling options.
Terraform Enterprise Data
Terraform Enterprise uses the following types of data.
PostgreSQL Database: - Stateful Terraform Enterprise application data. This includes workspace settings, organization settings, run information, and user information.
Object Storage: - Artifacts that Terraform Enterprise produces during operation. This includes state files, plan files, run logs, configuration versions, etc.
Vault: - Encryption keys that encrypt and decrypt objects within object storage.
Redis: Application coordination and data caching.
Operational Modes
The following table summarizes where each Terraform Enterprise operational mode stores each type of application data.
Operational Mode | PostgreSQL Database | Object Storage | Vault | Redis |
---|---|---|---|---|
External Services | External, user-managed PostgreSQL database | External, user-managed object storage location | PostgreSQL Database unless using External Vault | Docker volume on the instance |
Active/Active and Kubernetes | External, user-managed PostgreSQL database | External, user-managed object storage location | PostgreSQL Database unless using External Vault | External, user-managed Redis instance |
Mounted Disk | Directory on the instance backed by user-managed persistent storage | Directory on the instance backed by user-managed persisent storage | PostgreSQL Database unless using External Vault | Docker volume on the instance |
Active/Active and Kubernetes
Kubernetes installations do not require an operational mode to be specified. By default it has the same requirements as Active/Active to allow the pod to properly migrate between cluster nodes and scale when necessary. If an operational mode is specified in the helm chart, it is ignored, and you will see a warning in the startup log.
This operational mode stores the PostgreSQL Database and Object Storage data on an external PostgreSQL server and S3-compatible object storage. This allows you to backup, restore, and scale the PostgreSQL Database or Object Storage independently of the Terraform Enterprise instance. Additionally, temporary job data is stored in an external Redis instance, allowing you to use multiple instances of Terraform Enterprise.
You are responsible for providing and maintaining the external PostgreSQL server, S3-compatible object storage, and Redis instance.
When to Use Active/Active
We recommend Active/Active for the following use cases:
- 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, Azure Database for PostgreSQL, etc.
- You have experience managing an S3-compatible object storage location such as AWS S3, Azure Blob Storage, Google Cloud Storage, MinIO, etc.
- You have experience managing a Redis instance such as AWS ElastiCache for Redis, Azure Cache for Redis, Google Cloud Memorystore for Redis, etc.
- 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 Services
The External Services operational mode stores the PostgreSQL Database and Object Storage data on an external PostgreSQL server and S3-compatible object storage. This allows you to backup, restore, and scale the PostgreSQL Database or Object Storage independently of the Terraform Enterprise instance.
You are responsible for providing and maintaining the external PostgreSQL server and S3-compatible object storage.
You must configure Active/Active mode to use multiple Terraform Enterprise instances
When to Use External Services
We recommend using External Services in the following use cases:
- Your environment has an external PostgreSQL server and S3-compatible object storage.
- You have experience managing a PostgreSQL server such as Amazon RDS for PostgreSQL, Google Cloud SQL for PostgreSQL, Azure Database for PostgreSQL, etc.
- You have experience managing an S3-compatible object storage location such as AWS S3, Azure Blob Storage, Google Cloud Storage, MinIO, etc.
- You want to use native backup and restore features provided by the external PostgreSQL server and S3-compatible object storage.
Mounted Disk
The Mounted Disk operational mode stores the PostgreSQL Database and Object Storage data in a directory on the instance. It is expected that this directory is backed by persistent storage that you can mount to the instance. This allows you to backup and restore the PostgreSQL Database or Object Storage data independently of the Terraform Enterprise instance.
You are responsible for providing and maintaining the persistent storage.
You must configure Active/Active mode to use multiple Terraform Enterprise instances
There are specific tfectl
commands available to help manage a mounted disk installation.
When to Use Mounted Disk
We recommend Mounted Disk for the following use cases:
- 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, an iSCSI location, etc.
- You are familiar with using tools like
cp
,scp
, andrsync
to backup and restore data.