Commit 250f4d24 authored by Ville Gustafsson's avatar Ville Gustafsson Committed by GitHub

support more nodes than there are AZs defined (#108)

* allow empty list of availability_zones

availability_zones parameter shouldn't be required

* enable more nodes to be created than AZs

* Updated README.md
Co-authored-by: default avataractions-bot <58130806+actions-bot@users.noreply.github.com>
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent bfb16e46
...@@ -86,7 +86,7 @@ resource "aws_elasticache_replication_group" "default" { ...@@ -86,7 +86,7 @@ resource "aws_elasticache_replication_group" "default" {
number_cache_clusters = var.cluster_mode_enabled ? null : var.cluster_size number_cache_clusters = var.cluster_mode_enabled ? null : var.cluster_size
port = var.port port = var.port
parameter_group_name = join("", aws_elasticache_parameter_group.default.*.name) parameter_group_name = join("", aws_elasticache_parameter_group.default.*.name)
availability_zones = var.cluster_mode_enabled ? null : slice(var.availability_zones, 0, var.cluster_size) availability_zones = length(var.availability_zones) == 0 ? null : [for n in range(0, var.cluster_size) : element(var.availability_zones, n)]
automatic_failover_enabled = var.automatic_failover_enabled automatic_failover_enabled = var.automatic_failover_enabled
multi_az_enabled = var.multi_az_enabled multi_az_enabled = var.multi_az_enabled
subnet_group_name = local.elasticache_subnet_group_name subnet_group_name = local.elasticache_subnet_group_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment