Skip to content

Commit e3197a7

Browse files
committed
Adding an optional engine flag, so module consumers can use Valkey as an engine
1 parent e0fd874 commit e3197a7

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

locals.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ locals {
2424

2525
automatic_failover_enabled = var.automatic_failover_enabled != null ? var.automatic_failover_enabled : var.nodes >= 2
2626

27-
engine = "redis"
28-
2927
creator = "terraform"
3028

3129
defaulted_tags = merge(

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "aws_elasticache_replication_group" "replication_group" {
88
auto_minor_version_upgrade = var.auto_minor_version_upgrade
99
automatic_failover_enabled = local.automatic_failover_enabled
1010
data_tiering_enabled = var.data_tiering_enabled
11-
engine = local.engine
11+
engine = var.engine
1212
engine_version = var.engine_version
1313
final_snapshot_identifier = var.final_snapshot_identifier
1414
global_replication_group_id = var.global_replication_group_id

optional.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ variable "auto_minor_version_upgrade" {
2222
type = bool
2323
}
2424

25+
variable "engine" {
26+
description = "The engine to use ('valkey' or 'redis')"
27+
default = "redis"
28+
type = string
29+
validation {
30+
condition = contains(["redis", "valkey"], var.engine)
31+
error_message = "Engine must be 'redis' or 'valkey'"
32+
}
33+
}
34+
2535
variable "engine_version" {
2636
description = "Version number of the cache engine to be used. If not set, defaults to the latest version. See Describe Cache Engine Versions in the AWS Documentation for supported versions. When engine is redis and the version is 6 or higher, the major and minor version can be set, e.g., 6.2, or the minor version can be unspecified which will use the latest version at creation time, e.g., 6.x. Otherwise, specify the full version desired, e.g., 5.0.6."
2737
default = null

0 commit comments

Comments
 (0)