Skip to content

Commit

Permalink
feat(elasticache-redis): add engine input for valkey support
Browse files Browse the repository at this point in the history
Signed-off-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
  • Loading branch information
nitrocode committed Oct 29, 2024
1 parent c9e2a90 commit d6c744d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/elasticache-redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ components:
num_replicas: 1
num_shards: 0
replicas_per_shard: 0
engine: "redis"
engine_version: 6.0.5
instance_type: cache.t2.small
parameters:
Expand Down Expand Up @@ -109,6 +110,7 @@ No resources.
| <a name="input_at_rest_encryption_enabled"></a> [at\_rest\_encryption\_enabled](#input\_at\_rest\_encryption\_enabled) | Enable encryption at rest | `bool` | n/a | yes |
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
| <a name="input_auth_token_enabled"></a> [auth\_token\_enabled](#input\_auth\_token\_enabled) | Enable auth token | `bool` | `true` | no |
| <a name="input_auto_minor_version_upgrade"></a> [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported if the engine version is 6 or higher. | `bool` | `false` | no |
| <a name="input_automatic_failover_enabled"></a> [automatic\_failover\_enabled](#input\_automatic\_failover\_enabled) | Enable automatic failover | `bool` | n/a | yes |
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | Availability zone IDs | `list(string)` | `[]` | no |
| <a name="input_cloudwatch_metric_alarms_enabled"></a> [cloudwatch\_metric\_alarms\_enabled](#input\_cloudwatch\_metric\_alarms\_enabled) | Boolean flag to enable/disable CloudWatch metrics alarms | `bool` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions modules/elasticache-redis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module "redis_clusters" {
num_replicas = lookup(each.value, "num_replicas", 1)
num_shards = lookup(each.value, "num_shards", 0)
replicas_per_shard = lookup(each.value, "replicas_per_shard", 0)
engine = lookup(each.value, "engine", "redis")
engine_version = each.value.engine_version
create_parameter_group = lookup(each.value, "create_parameter_group", true)
parameters = lookup(each.value, "parameters", null)
Expand Down
3 changes: 2 additions & 1 deletion modules/elasticache-redis/modules/redis_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locals {

module "redis" {
source = "cloudposse/elasticache-redis/aws"
version = "1.4.1"
version = "1.7.0"

name = var.cluster_name

Expand All @@ -29,6 +29,7 @@ module "redis" {
cluster_mode_replicas_per_node_group = var.replicas_per_shard
cluster_size = var.num_replicas
dns_subdomain = var.dns_subdomain
engine = var.engine
engine_version = var.engine_version
family = var.cluster_attributes.family
instance_type = var.instance_type
Expand Down
6 changes: 6 additions & 0 deletions modules/elasticache-redis/modules/redis_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ variable "create_parameter_group" {
description = "Whether new parameter group should be created. Set to false if you want to use existing parameter group"
}

variable "engine" {
type = string
default = "redis"
description = "Name of the cache engine"
}

variable "engine_version" {
type = string
description = "Redis Version"
Expand Down

0 comments on commit d6c744d

Please sign in to comment.