The module creates and manages DigitalOcean DB cluster with Valkey engine and flexible configuration.

The Valkey cluster may contain 1 to 3 nodes, where 1 is a Primary node and up to 2 Standby nodes can be managed in the cluster layout.

NOTE: For a cluster setup, a machine with at least 2Gb of RAM is required. Smaller machines can only be used for single-node setups.

Log in to Corewide IaC registry

Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:

 shellterraform login solutions.corewide.com
Provision instructions

Initialize mandatory providers:

Copy and paste into your Terraform configuration and insert the variables:

 hclmodule "tf_do_cache" {
  source  = "solutions.corewide.com/digitalocean/tf-do-cache/digitalocean"
  version = "~> 2.0.0"

  # specify module inputs here or try one of the examples below
  ...
}

Initialize the setup:

 shellterraform init
Define update strategy

Corewide DevOps team strictly follows Semantic Versioning Specification to provide our clients with products that have predictable upgrades between versions. We recommend pinning patch versions of our modules using pessimistic constraint operator (~>) to prevent breaking changes during upgrades.

To get new features during the upgrades (without breaking compatibility), use ~> 2.0 and run terraform init -upgrade

For the safest setup, use strict pinning with version = "2.0.0"

Managed Valkey (ex-Redis) in DigitalOcean

Creates managed database with Valkey engine in DigitalOcean
$500
BUY
294
v2.0.0 released 1 month, 2 weeks ago
New version approx. every 7 weeks

The module creates and manages DigitalOcean DB cluster with Valkey engine and flexible configuration.

The Valkey cluster may contain 1 to 3 nodes, where 1 is a Primary node and up to 2 Standby nodes can be managed in the cluster layout.

NOTE: For a cluster setup, a machine with at least 2Gb of RAM is required. Smaller machines can only be used for single-node setups.

Minimal setup with required parameters only:

 hclmodule "cache" {
  source  = "solutions.corewide.com/digitalocean/tf-do-cache/digitalocean"
  version = "~> 2.0"

  region      = "fra1"
  name_prefix = "develop"
}

Full setup, configures the Valkey with specified parameters, adds trusted sources, and tags the cluster as dev:

 hclmodule "cache" {
  source  = "solutions.corewide.com/digitalocean/tf-do-cache/digitalocean"
  version = "~> 2.0"

  region          = "fra1"
  name_prefix     = "develop"
  machine_size    = "db-s-2vcpu-2gb"
  node_count      = 2
  eviction_policy = "allkeys_lru"
  vpc_id          = "xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy"

  maintenance_window = {
    day  = "Tue"
    hour = 15
  }

  trusted_sources = [
    {
      type  = "ip_addr"
      value = "10.114.32.24"
    },
    {
      type  = "k8s"
      value = "123ab45-67c8-de9f0-1ghj23"
    },
  ]

  tags = [
    "dev",
  ]
}
Variable Description Type Default Required Sensitive
name_prefix Name prefix for the created resources string yes no
region DigitalOcean region to create resources in string yes no
engine_version Valkey engine version number 8 no no
eviction_policy The eviction policy for a Valkey. Possible values are: noeviction, allkeys_lru, allkeys_random, volatile_lru, volatile_random, or volatile_ttl string noeviction no no
machine_size Database Droplet size associated with the cluster string db-s-1vcpu-1gb no no
maintenance_window Maintenance window configuration object {} no no
maintenance_window.day The day of the week (Mon, Tue, etc.) the maintenance window occurs string Mon no no
maintenance_window.hour The hour when the maintenance updates are applied, in UTC 24-hour format. Examples: 2, 3, 23 number 2 no no
node_count Number of cluster nodes. Possible values are: 1, 2, and 3 number 1 no no
tags List of tags to be assigned to the cluster resource list(string) [] no no
trusted_sources List of trusted sources to restrict connections to the database cluster list(object) [] no no
trusted_sources[*].type Type of resource that the firewall rule allows to access the database cluster. Possible values are: droplet, k8s, ip_addr, tag, or app string yes no
trusted_sources[*].value ID of the specific resource, name of a tag applied to a group of resources, or IP address that the firewall rule allows to access the database cluster string yes no
vpc_id The ID of the VPC where the database cluster will be located. If not provided, default DigitalOcean VPC is used string no no
Output Description Type Sensitive
cluster Cluster resource attributes resource yes
connection_parameters Connection parameters for Valkey map yes
Dependency Version Kind
terraform >= 1.3 CLI
digitalocean/digitalocean ~> 2.53 provider

Not sure where to start?
Let's find your perfect match.