Closed rewt closed 4 years ago
The issue is that aws_elasticache_replication_group
cannot have both cluster_mode
and number_cache_clusters
as specified here.
@rewt I'm seeing the same. Did you get that figured out?
@rewt I'm seeing the same. Did you get that figured out?
I just used my own code for the time being.
Gotcha.
For others that come across this issue, this seems to be a recent change in AWS APIs or the underlying AWS Provider which causes this problem. I attempted to fix this in my own fork here, but I wasn't able to get that to work so I instead swapped over to not using cluster_mode_enabled
and increasing my cluster_size
which provides enough resilience for my current project.
@Gowiem I took a crack at it and it's working for me: https://github.com/cloudposse/terraform-aws-elasticache-redis/pull/65. Using null
instead of 0
removed the need for setting depends_on
.
Also, it looked like we also needed to get rid of availability_zones
(maybe it's worth the extra work to implement preferred_availability_zones
?).
@samsullivan Aha null
> 0
did it. Interesting. Thanks for pointing that out and fixing via PR. Hopefully that helps out others if they require a cluster!
I would assume preferred_availability_zones
would be desirable since you would want your redis servers co-located in the same AZs as your application servers. Probably worth opening another bug for that enhancement.
@Gowiem I don't think it's entirely necessary, since the underlying resource seems intelligent enough. When doing:
cluster_mode_enabled = true
cluster_mode_num_node_groups = length(local.azs)
cluster_mode_replicas_per_node_group = 1
I got 1 node/AZ when passing 1 subnet/AZ. I think preferred_availability_zones
is necessary for more unique setups like most nodes in a specific AZ, etc., and therefore should be out of scope of the bugfix to creating Redis in cluster mode.
Would appreciate getting that PR merged, unsure if @rewt were able to give this a try successfully or not.
Found a bug? Maybe our Slack Community can help.
Describe the Bug
Module fails to create
Clustered Redis
elasticache resource with error:Expected Behavior
Successful creation of
Clustered Redis
resource whenvar.cluster_mode_enabled=true
Steps to Reproduce
Steps to reproduce the behavior:
cluster_mode_enabled
default=true
cluster_mode_replicas_per_node_group
default=1
cluster_mode_num_node_groups
default=3
Screenshots
If applicable, add screenshots or logs to help explain your problem.
Environment (please complete the following information):
Additional Context
plan.txt Add any other context about the problem here.