Introduction
This guide explains how to configure Terraform Enterprise to connect to a Redis Enterprise data store. As of version 1.1.0, Terraform Enterprise no longer supports Redis 6.0, which reached its end-of-life in May 2022.
This change requires users of Redis 6.0, including through managed services such as Azure Cache for Redis, to migrate to a newer version of Redis. Azure customers may choose to migrate to Azure Managed Redis, which uses Redis 7.4.x Enterprise.
Expected Outcome
After completing this guide, you will have successfully configured your active-active Terraform Enterprise instance to use Redis Enterprise for its cache and background job queue.
Prerequisites
- An active-active deployment of Terraform Enterprise version 1.1.0 or later.
- Access to a Redis Enterprise instance configured in non-clustering mode.
- Administrative access to modify the Terraform Enterprise environment configuration.
Use Case
This procedure is required when you use Redis Enterprise as the external Redis data store for a Terraform Enterprise active-active installation. Redis Enterprise does not support numbered databases, which Terraform Enterprise typically uses to isolate its internal components. To accommodate this, you must configure a separate Redis endpoint specifically for the sidekiq background job processor.
A common scenario is migrating from an older Azure Cache for Redis instance (based on Redis 6.0) to a newer tier that is backed by Redis Enterprise.
Procedure
Follow these steps to configure the necessary environment variables for the sidekiq Redis connection.
-
Access Configuration: Open the configuration file for your Terraform Enterprise environment. This could be a Docker Compose file, a Kubernetes Helm chart (
values.yaml), or a Nomad job file. -
Add Sidekiq Redis Variables: Add the following
TFE_REDIS_SIDEKIQ_*environment variables to your configuration. These variables define a dedicated connection for thesidekiqservice, allowing it to operate correctly with Redis Enterprise.The specific variables you need depend on your Redis Enterprise server's security configuration.
Basic Connection (No TLS or Authentication)
Set the
TFE_REDIS_SIDEKIQ_HOSTvariable to the hostname and optional port of your Redis server.TFE_REDIS_SIDEKIQ_HOST="redis.example.com:6379"
Connection with TLS
If your Redis server requires TLS, set
TFE_REDIS_SIDEKIQ_USE_TLStotrue.TFE_REDIS_SIDEKIQ_HOST="redis.example.com:6379" TFE_REDIS_SIDEKIQ_USE_TLS="true"
Connection with Password Authentication
If your server requires a password, set
TFE_REDIS_SIDEKIQ_USE_AUTHtotrueand provide the password.TFE_REDIS_SIDEKIQ_HOST="redis.example.com:6379" TFE_REDIS_SIDEKIQ_USE_AUTH="true" TFE_REDIS_SIDEKIQ_PASSWORD="your-redis-password"
Connection with mTLS Authentication
For mutual TLS, set
TFE_REDIS_SIDEKIQ_USE_MTLStotrueand provide the paths to your client certificate, private key, and CA certificate files. These files must be available within the Terraform Enterprise container at the specified paths.TFE_REDIS_SIDEKIQ_HOST="redis.example.com:6379" TFE_REDIS_SIDEKIQ_USE_MTLS="true" TFE_REDIS_SIDEKIQ_CLIENT_CERT_PATH="/path/to/client.crt" TFE_REDIS_SIDEKIQ_CLIENT_KEY_PATH="/path/to/client.key" TFE_REDIS_SIDEKIQ_CA_CERT_PATH="/path/to/ca.crt"
- Apply Configuration: Save your changes to the configuration file.
-
Restart Terraform Enterprise: Restart the Terraform Enterprise application to apply the new settings. The method for restarting depends on your deployment platform (e.g.,
docker-compose up -d,helm upgrade,nomad run). -
Verify the Connection: After the application restarts, check the logs for the
ptfe_sidekiqcontainer. Look for messages indicating a successful connection to the Redis server. You should also verify that the Terraform Enterprise UI is responsive and that runs are being processed correctly.
Additional Information
- This configuration is only necessary for active-active operational mode. Standalone deployments in
diskmode manage Redis internally. - Terraform Enterprise does not support Redis Cluster mode.
- For more details on Redis configuration, refer to the official documentation on how to Configure Redis data store connection.
- A complete list of variables is available in the Terraform Enterprise configuration reference.