Skip to content

Commit 6b1b5aa

Browse files
authored
feat: Support Valkey (#26)
1 parent 347d65c commit 6b1b5aa

File tree

27 files changed

+466
-37
lines changed

27 files changed

+466
-37
lines changed

README.md

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,86 @@ module "elasticache" {
268268
}
269269
```
270270

271+
### Serverless Cache
272+
273+
```hcl
274+
module "elasticache" {
275+
source = "terraform-aws-modules/elasticache/aws//modules/serverless-cache"
276+
277+
engine = "redis"
278+
cache_name = "example-serverless-cache"
279+
280+
cache_usage_limits = {
281+
data_storage = {
282+
maximum = 2
283+
}
284+
ecpu_per_second = {
285+
maximum = 1000
286+
}
287+
}
288+
289+
daily_snapshot_time = "22:00"
290+
description = "example-serverless-cache serverless cluster"
291+
kms_key_id = aws_kms_key.this.arn
292+
major_engine_version = "7"
293+
security_group_ids = [module.sg.security_group_id]
294+
295+
snapshot_retention_limit = 7
296+
subnet_ids = module.vpc.private_subnets
297+
298+
user_group_id = module.cache_user_group.group_id
299+
}
300+
```
301+
302+
### Valkey Replication Group
303+
304+
```hcl
305+
module "elasticache" {
306+
source = "terraform-aws-modules/elasticache/aws"
307+
308+
replication_group_id = local.name
309+
310+
engine = "valkey"
311+
engine_version = "7.2"
312+
node_type = "cache.t4g.small"
313+
314+
transit_encryption_enabled = true
315+
auth_token = "PickSomethingMoreSecure123!"
316+
maintenance_window = "sun:05:00-sun:09:00"
317+
apply_immediately = true
318+
319+
# Security Group
320+
vpc_id = module.vpc.vpc_id
321+
security_group_rules = {
322+
ingress_vpc = {
323+
# Default type is `ingress`
324+
# Default port is based on the default engine port
325+
description = "VPC traffic"
326+
cidr_ipv4 = module.vpc.vpc_cidr_block
327+
}
328+
}
329+
330+
# Subnet Group
331+
subnet_group_name = local.name
332+
subnet_group_description = "Valkey replication group subnet group"
333+
subnet_ids = module.vpc.private_subnets
334+
335+
# Parameter Group
336+
create_parameter_group = true
337+
parameter_group_name = local.name
338+
parameter_group_family = "valkey7"
339+
parameter_group_description = "Valkey replication group parameter group"
340+
parameters = [
341+
{
342+
name = "latency-tracking"
343+
value = "yes"
344+
}
345+
]
346+
347+
tags = local.tags
348+
}
349+
```
350+
271351
## Examples
272352

273353
Examples codified under the [`examples`](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples) are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!
@@ -277,21 +357,23 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
277357
- [Redis Cluster Mode](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-cluster-mode)
278358
- [Redis Global Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-global-replication-group)
279359
- [Redis Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-replication-group)
360+
- [Serverless Cache](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/serverless-cache)
361+
- [Valkey Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/valkey-replication-group)
280362

281363
<!-- BEGIN_TF_DOCS -->
282364
## Requirements
283365

284366
| Name | Version |
285367
|------|---------|
286368
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
287-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.71 |
369+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.73 |
288370
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
289371

290372
## Providers
291373

292374
| Name | Version |
293375
|------|---------|
294-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.71 |
376+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.73 |
295377
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
296378

297379
## Modules
@@ -322,7 +404,7 @@ No modules.
322404
| <a name="input_at_rest_encryption_enabled"></a> [at\_rest\_encryption\_enabled](#input\_at\_rest\_encryption\_enabled) | Whether to enable encryption at rest | `bool` | `true` | no |
323405
| <a name="input_auth_token"></a> [auth\_token](#input\_auth\_token) | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true` | `string` | `null` | no |
324406
| <a name="input_auth_token_update_strategy"></a> [auth\_token\_update\_strategy](#input\_auth\_token\_update\_strategy) | Strategy to use when updating the `auth_token`. Valid values are `SET`, `ROTATE`, and `DELETE`. Defaults to `ROTATE` | `string` | `null` | no |
325-
| <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 for engine type `redis` and if the engine version is 6 or higher. Defaults to `true` | `bool` | `null` | no |
407+
| <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 for engine type `redis` and `valkey` and if the engine version is 6 or higher. Defaults to `true` | `bool` | `null` | no |
326408
| <a name="input_automatic_failover_enabled"></a> [automatic\_failover\_enabled](#input\_automatic\_failover\_enabled) | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis (cluster mode enabled) replication groups | `bool` | `null` | no |
327409
| <a name="input_availability_zone"></a> [availability\_zone](#input\_availability\_zone) | Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use `preferred_availability_zones` instead | `string` | `null` | no |
328410
| <a name="input_az_mode"></a> [az\_mode](#input\_az\_mode) | Whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are `single-az` or `cross-az`, default is `single-az` | `string` | `null` | no |
@@ -339,13 +421,13 @@ No modules.
339421
| <a name="input_create_subnet_group"></a> [create\_subnet\_group](#input\_create\_subnet\_group) | Determines whether the Elasticache subnet group will be created or not | `bool` | `true` | no |
340422
| <a name="input_data_tiering_enabled"></a> [data\_tiering\_enabled](#input\_data\_tiering\_enabled) | Enables data tiering. Data tiering is only supported for replication groups using the `r6gd` node type. This parameter must be set to true when using `r6gd` nodes | `bool` | `null` | no |
341423
| <a name="input_description"></a> [description](#input\_description) | User-created description for the replication group | `string` | `null` | no |
342-
| <a name="input_engine"></a> [engine](#input\_engine) | Name of the cache engine to be used for this cache cluster. Valid values are `memcached` or `redis` | `string` | `"redis"` | no |
424+
| <a name="input_engine"></a> [engine](#input\_engine) | Name of the cache engine to be used for this cache cluster. Valid values are `memcached`, `redis`, or `valkey` | `string` | `"redis"` | no |
343425
| <a name="input_engine_version"></a> [engine\_version](#input\_engine\_version) | Version number of the cache engine to be used. If not set, defaults to the latest version | `string` | `null` | no |
344426
| <a name="input_final_snapshot_identifier"></a> [final\_snapshot\_identifier](#input\_final\_snapshot\_identifier) | (Redis only) Name of your final cluster snapshot. If omitted, no final snapshot will be made | `string` | `null` | no |
345427
| <a name="input_global_replication_group_id"></a> [global\_replication\_group\_id](#input\_global\_replication\_group\_id) | The ID of the global replication group to which this replication group should belong | `string` | `null` | no |
346428
| <a name="input_ip_discovery"></a> [ip\_discovery](#input\_ip\_discovery) | The IP version to advertise in the discovery protocol. Valid values are `ipv4` or `ipv6` | `string` | `null` | no |
347429
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `null` | no |
348-
| <a name="input_log_delivery_configuration"></a> [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log | `any` | <pre>{<br/> "slow-log": {<br/> "destination_type": "cloudwatch-logs",<br/> "log_format": "json"<br/> }<br/>}</pre> | no |
430+
| <a name="input_log_delivery_configuration"></a> [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis OSS or Valkey) Specifies the destination and format of Redis OSS/Valkey SLOWLOG or Redis OSS/Valkey Engine Log | `any` | <pre>{<br/> "slow-log": {<br/> "destination_type": "cloudwatch-logs",<br/> "log_format": "json"<br/> }<br/>}</pre> | no |
349431
| <a name="input_maintenance_window"></a> [maintenance\_window](#input\_maintenance\_window) | Specifies the weekly time range for when maintenance on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC) | `string` | `null` | no |
350432
| <a name="input_multi_az_enabled"></a> [multi\_az\_enabled](#input\_multi\_az\_enabled) | Specifies whether to enable Multi-AZ Support for the replication group. If true, `automatic_failover_enabled` must also be enabled. Defaults to `false` | `bool` | `false` | no |
351433
| <a name="input_network_type"></a> [network\_type](#input\_network\_type) | The IP versions for cache cluster connections. Valid values are `ipv4`, `ipv6` or `dual_stack` | `string` | `null` | no |

examples/memcached-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.71 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.73 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.71 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.73 |
3030

3131
## Modules
3232

examples/memcached-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.71"
7+
version = ">= 5.73"
88
}
99
}
1010
}

examples/redis-cluster-mode/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Note that this example may create resources which will incur monetary charges on
2222
| Name | Version |
2323
|------|---------|
2424
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.71 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.73 |
2626

2727
## Providers
2828

2929
| Name | Version |
3030
|------|---------|
31-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.71 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.73 |
3232

3333
## Modules
3434

examples/redis-cluster-mode/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.71"
7+
version = ">= 5.73"
88
}
99
}
1010
}

examples/redis-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.71 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.73 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.71 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.73 |
3030

3131
## Modules
3232

examples/redis-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.71"
7+
version = ">= 5.73"
88
}
99
}
1010
}

examples/redis-global-replication-group/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Note that this example may create resources which will incur monetary charges on
2424
| Name | Version |
2525
|------|---------|
2626
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.71 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.73 |
2828

2929
## Providers
3030

3131
| Name | Version |
3232
|------|---------|
33-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.71 |
34-
| <a name="provider_aws.euwest1"></a> [aws.euwest1](#provider\_aws.euwest1) | >= 5.71 |
33+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.73 |
34+
| <a name="provider_aws.euwest1"></a> [aws.euwest1](#provider\_aws.euwest1) | >= 5.73 |
3535

3636
## Modules
3737

examples/redis-global-replication-group/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.71"
7+
version = ">= 5.73"
88
}
99
}
1010
}

examples/redis-replication-group-with-cluster-replica/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.71 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.73 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.71 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.73 |
3030

3131
## Modules
3232

0 commit comments

Comments
 (0)