Redis and Terraform intersect in two distinct but related patterns: using Terraform to provision and manage Redis Cloud subscriptions and databases as infrastructure as code, and configuring Terraform Enterprise to use an external Redis data store for caching and job scheduling. Both patterns rely on the Redis Cloud Terraform provider, provider credentials, and operational mode settings. This article covers the full lifecycle of Redis Cloud management with Terraform, the local build process for the provider, and the Terraform Enterprise Redis connection requirements including TLS and mutual TLS authentication.
Redis Cloud Terraform Provider Overview
The Redis Enterprise Cloud Terraform provider is a plugin for Terraform that allows Redis Enterprise Cloud customers to manage the full lifecycle of their subscriptions and related Redis databases.
Redis has developed a Terraform provider for Redis Cloud that allows you to deploy and manage Redis Cloud subscriptions, databases, and network peering as code on any cloud provider.
It is a plugin for Terraform that lets Redis Cloud Flexible customers manage the full lifecycle of their subscriptions and related Redis databases.
The provider needs to be configured with the proper credentials before it can be used.
A Terraform configuration is a complete document in the Terraform language that tells Terraform how to manage a given collection of infrastructure. It consists of three main components:
- Providers — connect to cloud APIs
- Data sources — read existing infrastructure information
- Resources — define infrastructure to be created
You can deploy Redis Cloud databases on AWS using Terraform by configuring the Redis Cloud Terraform provider, defining your subscription and database resources in a .tf file, and running terraform apply. This gives you repeatable, version-controlled infrastructure-as-code for your Redis deployments.
Installing and Building the Provider Locally
The provider is available from the RedisLabs repository. Building it locally is required when using a custom or development version.
Clone the repository
Enter the repository directory
Build the provider using the make build command:
$ make build
The make build command will build a local provider binary into a bin directory at the root of the repository.
After the provider has been built locally it must be placed in the user plugins directory so it can be discovered by the Terraform CLI
Building locally gives control over the binary placement and version used. Once placed in the user plugins directory Terraform can discover and load the provider for configurations that reference rediscloud.
Configuring Credentials and Environment Variables
To use the Redis Enterprise Cloud Terraform provider you will need to set the following environment variables, and these are created through the Redis Enterprise Cloud console under the settings menu.
Required environment variables:
- REDISCLOUDACCESSKEY
- Account Cloud API Access Key
- REDISCLOUDSECRETKEY
- Individual user Cloud API Secret Key
Prerequisites for using Terraform with Redis Cloud:
- Terraform installed on your machine
- A Redis Cloud account with a Flexible or Annual subscription
- Redis Cloud API access enabled with an API account key and API user key
- An AWS account
The provider needs to be configured with the proper credentials before it can be used.
A provider is the first resource that must be defined in any Terraform configuration file. It gives you access to the cloud API you will interact with to create resources. Terraform supports more than 100 cloud providers.
A provider defines resources and data for a particular infrastructure, such as AWS. The terraform {} block contains settings including the required providers Terraform will use to provision your infrastructure, for example, the rediscloud provider.
The provider {} block configures the specific provider. In the following example, it is AWS.
Terraform Configuration Structure for Redis Cloud
Resources are the most important element in the Terraform language. They describe the infrastructure to be created, from compute instances to specific permissions and more.
The resource {} block defines components of your infrastructure
How to install and configure the Redis Cloud Terraform provider
How to define Redis Cloud subscriptions and databases as Terraform resources
How to use Terraform data sources for payment methods and cloud accounts
How to create an execution plan and apply it to provision Redis on AWS
How to clean up resources with terraform destroy
Why Terraform for Redis Cloud:
- Multi-cloud support — Terraform works with AWS, Google Cloud, Azure, DigitalOcean, and more, using a single unified syntax.
- Declarative configuration — Describe the desired state of your Redis infrastructure and let Terraform handle the provisioning.
- Immutable infrastructure — Configuration changes are applied smoothly and predictably.
- Plugin-based extensibility — The provider model supports almost any service that exposes APIs, including Redis Cloud.
- Client-only architecture — No server-side configuration management is required.
Development teams today are embracing DevOps principles like continuous integration and continuous delivery. Managing infrastructure-as-code has become essential for any cloud service.
IaC tools let you manage infrastructure with configuration files rather than through a graphical user interface, allowing you to build, change, and manage your infrastructure in a safe, consistent, and repeatable way.
HashiCorp Terraform is a leading open-source IaC tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files that can be shared among team members, versioned, reviewed, and reused.
Deploying Redis Cloud on AWS with Terraform
The typical workflow for provisioning Redis Cloud is:
- Configure the rediscloud provider with API credentials
- Define a subscription resource
- Define database resources within the subscription
- Use data sources for payment methods and cloud accounts
- Run terraform plan to preview changes
- Run terraform apply to provision Redis on AWS
- Run terraform destroy to clean up resources
This approach gives you repeatable, version-controlled infrastructure-as-code for your Redis deployments.
Terraform Enterprise Redis Integration
Terraform Enterprise uses Redis to cache and manage the background job scheduler queue across available hosts. Redis server configuration is required for any runtime platform configured to operate in active-active mode.
You can operate Terraform Enterprise in active-active mode on the following runtime platforms:
- Kubernetes
- OpenShift
- Nomad
The requirements for deploying Terraform Enterprise depend on the version you want to deploy, as well as the environment you plan to operate the software in, such as operating system, runtime, and storage systems. Check the software product compatibility report page for details.
Your managed Redis server may require additional configuration. For example, Azure Managed Redis is based on Redis Enterprise, which has additional authentication configuration requirements. Refer to the documentation for your distribution for more information.
Configure Redis data store connection
This topic describes how to configure Terraform Enterprise connection to an externally-managed Redis data store. This step is only necessary when operating Terraform Enterprise in an active-active operational mode. To allow Terraform Enterprise to self-manage Redis, configure Terraform Enterprise to run in disk operational mode on a compatible runtime platform, such as Docker or Podman. Refer to Configure operational mode for additional information.
Active-Active Mode and External Redis Requirements
Terraform Enterprise uses Redis to cache and manage the background job scheduler queue across available hosts. Redis server configuration is required for any runtime platform configured to operate in active-active mode.
For secure Redis servers, create a user with read and write access. The Redis user must have sufficient permissions to authenticate with Terraform Enterprise.
Verify that you meet the following requirements when TLS is required to connect to the Redis server:
- A valid TLS certificate and key are configured on the Redis server.
- The Redis server is properly configured to accept TLS connections.
- The Terraform Enterprise client is configured to use TLS when connecting to Redis
For Azure, you must provision a Redis instance for the main Redis service and an additional instance for Sidekiq
Version documentation exists for Terraform Enterprise:
- 1.2.x
- 1.1.x
- 1.0.x
- v202507-1
- v202506-1
- v202505-1
- v202504-1
- v202503-1
- v202502-2
- v202502-1
- v202501-1
- v202411-2
- v202411-1
- v202410-1
- v202409-3
- v202409-2
- v202409-1
- v202408-1
- No versions of this document exist before v202408-1. Click below to redirect to the version homepage.
- v202407-1
- v202406-1
- v202405-1
- v202404-2
- v202404-1
- v202402-2
- v202402-1
- v202401-2
- v202401-1
- v202312-1
- v202311-1
- v202310-1
- v202309-1
- v202308-1
- v202307-1
- v202306-1
- v202305-2
- v202305-1
- v202304-1
- v202303-1
- v202302-1
- v202301-2
- v202301-1
- v202212-2
- v202212-1
- v202211-1
- v202210-1
- v202209-2
- v202209-1
- v202208-3
- v202208-2
- v202208-1
- v202207-2
- v202207-1
- v202206-1
TLS and Mutual TLS Configuration for Terraform Enterprise Redis
You can configure Terraform Enterprise to use Redis client certificates to authenticate with the server for Redis standalone, Enterprise, and Sentinel. When providing client certificates, the password is not required.
Configure the following settings to use Redis client certificates:
- Set the TFEREDISUSE_MTLS variable to true
- Specify the path to the CA certificate file in the TFEREDISCACERTPATH variable
- Specify the path to the client certificate file in the TFEREDISCLIENTCERTPATH variable
- Specify the path to the client key in the TFEREDISCLIENTKEYPATH variable
Refer to the TLS configuration reference for additional information.
For detailed information on configuring TLS for Redis, refer to the official Redis documentation on encryption.
The requirements for deploying Terraform Enterprise depend on the version you want to deploy, as well as the environment you plan to operate the software in, such as operating system, runtime, and storage systems.
Prerequisites and Operational Considerations
Table of key provider and Terraform Enterprise settings:
| Category | Setting | Description |
|---|---|---|
| Redis Cloud Provider | REDISCLOUDACCESSKEY | Account Cloud API Access Key |
| Redis Cloud Provider | REDISCLOUDSECRETKEY | Individual user Cloud API Secret Key |
| Terraform Enterprise Redis | TFEREDISUSE_MTLS | Enable mutual TLS |
| Terraform Enterprise Redis | TFEREDISCACERTPATH | Path to CA certificate file |
| Terraform Enterprise Redis | TFEREDISCLIENTCERTPATH | Path to client certificate file |
| Terraform Enterprise Redis | TFEREDISCLIENTKEYPATH | Path to client key |
Operational mode notes:
- Active-active mode requires external Redis
- Disk mode allows Terraform Enterprise to self-manage Redis on Docker or Podman
- Active-active mode supported on Kubernetes, OpenShift, Nomad
Conclusion
Using Terraform with Redis spans two complementary workflows. For Redis Cloud customers, the Redis Enterprise Cloud Terraform provider enables full lifecycle management of subscriptions and databases through declarative configuration, API credentials, and repeatable apply workflows. The provider is built locally with make build and placed in the user plugins directory for discovery by the Terraform CLI.
For Terraform Enterprise operators, Redis is a critical backend for caching and job queue management. Active-active deployments require an externally managed Redis server with appropriate permissions, TLS configuration, and optionally mutual TLS using client certificates. Disk operational mode allows self-managed Redis on compatible runtimes.
Both patterns benefit from Terraform’s declarative model, version control, and plugin extensibility. Proper credential handling, TLS verification, and operational mode selection ensure secure, consistent provisioning of Redis infrastructure across cloud environments.