Terraform
Terraform Enterprise Operational Modes
You must choose an operational mode before you install and deploy Terraform Enterprise. Each operational mode changes where Terraform Enterprise stores its data.
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.
Configuration: - Configuration settings. This includes the hostname, object storage credentials, database credentials, concurrency settings, etc.
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 | Configuration |
---|---|---|---|---|---|
External Services | External, user-managed PostgreSQL database | External, user-managed object storage location | PostgreSQL Database unless using External Vault | Docker volume on the instance | Docker volume on the instance |
Active/Active | External, user-managed PostgreSQL database | External, user-managed object storage location | PostgreSQL Database unless using External Vault | External, user-managed Redis instance | Docker volume on the 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 | Docker volume on the instance |
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.
External Services stores configuration data on a Docker volume on the instance.
Use replicatedctl app-config export
to retrieve the configuration data.
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.
Active/Active
The Active/Active 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, Active/Active stores Redis data in an external Redis instance, allowing you to use multiple instances of Terraform Enterprise in an Active/Active architecture.
You are responsible for providing and maintaining the external PostgreSQL server, S3-compatible object storage, and Redis instance.
Active/Active stores configuration data on a Docker volume on the instance. Use
replicatedctl app-config export
to retrieve the configuration data.
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.
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.
Mounted Disk stores configuration data on a Docker volume on the instance. Use
replicatedctl app-config export
to retrieve the configuration data.
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.