Skip to content

Commit

Permalink
Merge pull request #9 from DNXLabs/feature/remove-number-cache-clusters
Browse files Browse the repository at this point in the history
Fix configuration name num_cache_clusters
  • Loading branch information
adenot authored Dec 10, 2024
2 parents f2e70a5 + 26f40d5 commit c804dc0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module "cache_redis" {
| name | Name of this Redis | `string` | n/a | yes |
| node\_type | The instance class to be used | `string` | n/a | yes |
| notification\_topic\_arn | n/a | `string` | `""` | no |
| number\_cache\_clusters | The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2 | `number` | `1` | no |
| num\_cache\_clusters | The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2 | `number` | `1` | no |
| parameter\_group\_name | The name of the parameter group to associate with this replication group | `string` | `null` | no |
| port | Port number for this Redis | `number` | `6379` | no |
| snapshot\_retention\_limit | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them | `number` | `0` | no |
Expand Down
4 changes: 2 additions & 2 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ variable "notification_topic_arn" {
default = ""
}

variable "number_cache_clusters" {
variable "num_cache_clusters" {
description = "The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2"
default = 1
}
Expand Down Expand Up @@ -120,4 +120,4 @@ variable "user_group_ids" {
description = "(Optional) User Group ID to associate with the replication group. Only a maximum of one (1) user group ID is valid. NOTE: This argument is a set because the AWS specification allows for multiple IDs. However, in practice, AWS only allows a maximum size of one."
type = set(string)
default = null
}
}
44 changes: 22 additions & 22 deletions redis.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ resource "random_string" "redis_password" {
}

resource "aws_elasticache_replication_group" "redis" {
replication_group_id = var.name
replication_group_description = var.name
automatic_failover_enabled = var.automatic_failover_enabled
at_rest_encryption_enabled = var.at_rest_encryption_enabled
transit_encryption_enabled = var.transit_encryption_enabled
multi_az_enabled = var.multi_az_enabled
auth_token = var.transit_encryption_enabled ? random_string.redis_password[0].result : null
engine = var.engine
engine_version = var.engine_version
kms_key_id = var.kms_key_id
maintenance_window = var.maintenance_window
node_type = var.node_type
notification_topic_arn = var.notification_topic_arn
number_cache_clusters = var.number_cache_clusters
port = var.port
security_group_ids = [aws_security_group.redis.id]
snapshot_retention_limit = var.snapshot_retention_limit
snapshot_window = var.snapshot_window
subnet_group_name = try(aws_elasticache_subnet_group.redis[0].name, var.subnet_group_name)
parameter_group_name = var.parameter_group_name
user_group_ids = var.user_group_ids
replication_group_id = var.name
description = var.name
automatic_failover_enabled = var.automatic_failover_enabled
at_rest_encryption_enabled = var.at_rest_encryption_enabled
transit_encryption_enabled = var.transit_encryption_enabled
multi_az_enabled = var.multi_az_enabled
auth_token = var.transit_encryption_enabled ? random_string.redis_password[0].result : null
engine = var.engine
engine_version = var.engine_version
kms_key_id = var.kms_key_id
maintenance_window = var.maintenance_window
node_type = var.node_type
notification_topic_arn = var.notification_topic_arn
num_cache_clusters = var.num_cache_clusters
port = var.port
security_group_ids = [aws_security_group.redis.id]
snapshot_retention_limit = var.snapshot_retention_limit
snapshot_window = var.snapshot_window
subnet_group_name = try(aws_elasticache_subnet_group.redis[0].name, var.subnet_group_name)
parameter_group_name = var.parameter_group_name
user_group_ids = var.user_group_ids

tags = {
"Name" = var.name
"EnvName" = var.environment_name
}
}
}

0 comments on commit c804dc0

Please sign in to comment.