Add Valkey support for ElastiCache (#158)
## Summary This PR adds support for AWS ElastiCache Valkey as an alternative to Redis, addressing #44. ## Changes - **Upgrade cloudposse module**: Updated `cloudposse/elasticache-redis/aws` from v0.53.0 to >= 1.9.1 - **Add engine parameter**: New `engine` field in `redis_config` supports both `redis` (default) and `valkey` - **AWS provider constraint**: Added requirement for AWS provider >= 5.73.0 in `byo-vpc/versions.tf` - **Documentation**: Added Valkey configuration examples to README ## Valkey Benefits Valkey is an open-source, Redis-compatible in-memory data store. AWS recommends using Valkey for cost savings. ## Usage To use Valkey instead of Redis: ```hcl redis_config = { engine = "valkey" engine_version = "7.2" family = "valkey7" } ``` ## Backwards Compatibility - Default engine remains `redis` - existing deployments continue to work unchanged - Users can opt-in to Valkey by setting `engine = "valkey" Note that this was mostly AI-generated. Closes #44 --------- Co-authored-by: Robert Fairburn <8029478+rfairburn@users.noreply.github.com>
This commit is contained in:
1 parent
e7408fb07a
commit
07fdf37d4b
6 files changed
+117
-7
No files matched your search
+3
-2
@@ -89,20 +89,21 @@ module "rds" {
|
||||
|
||||
module "redis" {
|
||||
source = "cloudposse/elasticache-redis/aws"
|
||||
version = "0.53.0"
|
||||
version = ">= 1.9.1"
|
||||
|
||||
name = var.redis_config.name
|
||||
replication_group_id = var.redis_config.replication_group_id == null ? var.redis_config.name : var.redis_config.replication_group_id
|
||||
elasticache_subnet_group_name = var.redis_config.elasticache_subnet_group_name == null ? var.redis_config.name : var.redis_config.elasticache_subnet_group_name
|
||||
availability_zones = var.redis_config.availability_zones
|
||||
vpc_id = var.vpc_config.vpc_id
|
||||
description = "Fleet Redis"
|
||||
description = "Fleet cache"
|
||||
#allowed_security_group_ids = concat(var.redis_config.allowed_security_group_ids, module.byo-db.ecs.security_group)
|
||||
subnets = var.redis_config.subnets
|
||||
cluster_size = var.redis_config.cluster_size
|
||||
instance_type = var.redis_config.instance_type
|
||||
apply_immediately = var.redis_config.apply_immediately
|
||||
automatic_failover_enabled = var.redis_config.automatic_failover_enabled
|
||||
engine = var.redis_config.engine
|
||||
engine_version = var.redis_config.engine_version
|
||||
family = var.redis_config.family
|
||||
at_rest_encryption_enabled = var.redis_config.at_rest_encryption_enabled
|
||||
|
||||
@@ -77,8 +77,9 @@ variable "redis_config" {
|
||||
instance_type = optional(string, "cache.m5.large")
|
||||
apply_immediately = optional(bool, true)
|
||||
automatic_failover_enabled = optional(bool, false)
|
||||
engine_version = optional(string, "6.x")
|
||||
family = optional(string, "redis6.x")
|
||||
engine = optional(string, "redis")
|
||||
engine_version = optional(string, "7.1")
|
||||
family = optional(string, "redis7")
|
||||
at_rest_encryption_enabled = optional(bool, true)
|
||||
transit_encryption_enabled = optional(bool, true)
|
||||
parameter = optional(list(object({
|
||||
@@ -100,6 +101,7 @@ variable "redis_config" {
|
||||
instance_type = "cache.m5.large"
|
||||
apply_immediately = true
|
||||
automatic_failover_enabled = false
|
||||
engine = "redis"
|
||||
engine_version = "6.x"
|
||||
family = "redis6.x"
|
||||
at_rest_encryption_enabled = true
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
terraform {
|
||||
required_version = ">= 1.3.8"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 5.73.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user