
The module creates and manages DigitalOcean DB cluster with Valkey engine and flexible configuration.
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
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
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"
The module creates and manages DigitalOcean DB cluster with Valkey engine and flexible configuration.
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
BREAKING CHANGE: DigitalOcean Managed Caching (aka Redis) has reached its end of availability (EOA) and was replaced by Managed Valkey. Management of the Valkey is incompatible with the previous versions. Upgrade from an older version leads to cache cluster re-creation , see Upgrade Notes section
eviction_policy
variabledigitalocean
provider version to 2.53
redis
to valkey
7
to 8
configuration_parameters
variable as its configuration became obsoleteconnection_parameters
output creating with empty key by changing output type to map
trusted_sources
variableFirst stable version
v1.x
to v2.x
Due to the replacement of Redis with Valkey engine for the Digitalocean managed Cache service, the module from version 2.0
switches Cache engine type and updates Cache cluster management, which is incompatible with the previous version. First, update the declaration of the module according to the requirements and examples to match the designed configuration, then re-init the module with an enabled upgrade:
bashterraform init -upgrade
Now the configuration can be applied, this will lead to the Cache cluster re-creation.
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 |