Skip to content

Valkey

Here are is some of the Terraform we have used for testing Platformatic:

resource "aws_elasticache_replication_group" "default" {
apply_immediately = true
automatic_failover_enabled = false
description = "Managed by Terraform"
engine = var.elasticache.engine
engine_version = var.elasticache.engine_version
maintenance_window = var.elasticache.maintenance_window
node_type = var.elasticache.node_type
num_cache_clusters = var.elasticache.num_cache_clusters
parameter_group_name = aws_elasticache_parameter_group.default.id
port = var.elasticache.port
replication_group_id = local.identifier
security_group_ids = [aws_security_group.default.id]
subnet_group_name = aws_elasticache_subnet_group.default.id
transit_encryption_enabled = true
user_group_ids = [aws_elasticache_user_group.default.id]
tags = local.tags
lifecycle {
ignore_changes = [num_cache_clusters]
}
}
resource "aws_elasticache_parameter_group" "default" {
name = local.identifier
family = var.elasticache.parameter_group_family
parameter {
name = "notify-keyspace-events"
value = "AKE"
}
}
resource "aws_elasticache_subnet_group" "default" {
name = local.identifier
subnet_ids = concat(
aws_subnet.public[*].id,
aws_subnet.private[*].id
)
tags = local.tags
}
resource "aws_elasticache_user" "default" {
user_id = local.identifier
user_name = "platformatic"
access_string = "on ~* +@all"
engine = var.elasticache.engine
tags = local.tags
authentication_mode {
type = "password"
passwords = [local.elasticache.password]
}
}
resource "aws_elasticache_user_group" "default" {
engine = var.elasticache.engine
user_group_id = local.identifier
user_ids = [aws_elasticache_user.default.id]
}
variable "elasticache" {
default = {
engine = "valkey"
engine_version = "8.0"
node_type = "cache.t3.micro"
num_cache_clusters = 1
parameter_group_family = "valkey8"
port = 6379
maintenance_window = "sun:07:00-sun:08:00"
}
}
variable "tags" {
type = map(any)
default = {}
}
locals {
identifier = "platformatic"
tags = merge(var.tags, {
Name = local.identifier
})
elasticache = {
username = "platformatic"
password = random_password.elasticache_password.result
}
}

Any way of hosting Valkey should work as long as a URL can be exposed for ICC to access. Some possible options: