Skip to content

Commit cf02fbd

Browse files
Add redis engine version var (#25)
* Add a new variable for configuring redis engine version Why this change is being made: - New Sidekiq versions require at lease redis 7.3 to run. We have it hardcoded in this playbook at 6.x. I want to make it so we can change an env var and upgrade our Redis version What were the changes made to support this: - Add a new variable to the redis-variables.tf - Set the default to 7.x - use the variable in redis.tf * Update readme
1 parent e8f43f0 commit cf02fbd

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ module "production" {
2929
postgres_max_allocated_storage = 128
3030
3131
# Redis
32-
redis_enabled = true
33-
redis_name = "example-production-blue"
34-
redis_node_type = "cache.m6g.large"
35-
redis_replica_count = 1
32+
redis_enabled = true
33+
redis_name = "example-production-blue"
34+
redis_node_type = "cache.m6g.large"
35+
redis_replica_count = 1
36+
redis_engine_version = "7.x"
3637
3738
# S3
3839
s3_enabled = true
@@ -178,6 +179,7 @@ module "production_v1" {
178179
| <a name="input_redis_name"></a> [redis\_name](#input\_redis\_name) | Name of the ElastiCache instance for Redis | `string` | `null` | no |
179180
| <a name="input_redis_node_type"></a> [redis\_node\_type](#input\_redis\_node\_type) | Node type for the ElastiCache instance for Redis | `string` | `null` | no |
180181
| <a name="input_redis_replica_count"></a> [redis\_replica\_count](#input\_redis\_replica\_count) | Number of replicas for the Redis cluster | `number` | `null` | no |
182+
| <a name="input_redis_engine_version"></a> [redis\ engine\ version](#input\_redis\_engine\_version) | ElastiCache instance Redis version| `string` | `null` | no |
181183
| <a name="input_s3_bucket_name"></a> [s3\_bucket\_name](#input\_s3\_bucket\_name) | Name of the S3 bucket for this application | `string` | `null` | no |
182184
| <a name="input_s3_enabled"></a> [s3\_enabled](#input\_s3\_enabled) | Set to true to enable creation of an S3 bucket | `bool` | `false` | no |
183185
| <a name="input_s3_read_principals"></a> [s3\_read\_principals](#input\_s3\_read\_principals) | Additional principals able to read S3 data | `list(string)` | `[]` | no |

redis-variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ variable "redis_enabled" {
44
default = false
55
}
66

7+
variable "redis_engine_version" {
8+
description = "The version of redis to run"
9+
type = string
10+
default = "7.x"
11+
}
12+
713
variable "redis_enable_kms" {
814
description = "Enable KMS encryption"
915
type = bool

redis.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module "redis" {
44

55
allowed_cidr_blocks = [module.network.vpc.cidr_block]
66
description = "Redis cluster for ${local.instance_name} jobs"
7-
engine_version = "6.x"
7+
engine_version = var.redis_engine_version
88
name = var.redis_name
99
node_type = var.redis_node_type
1010
replica_count = var.redis_replica_count

0 commit comments

Comments
 (0)