Closed adamwshero closed 2 years ago
I have the same issue, but cluster size = 1.
I get the same issue following a recent upgrade of aws provider version. Current settings: Terraform v1.1.9 on darwin_amd64
Previously I was using terraform v1.0.1 provider registry.terraform.io/hashicorp/aws v3.75.1
The previous settings did not exhibit this issue.
From the AWS provider docs:
cluster_mode - (Optional, Deprecated use root-level num_node_groups and replicas_per_node_group instead) Create a native Redis cluster. automatic_failover_enabled must be set to true. Cluster Mode documented below. Only 1 cluster_mode block is allowed. Note that configuring this block does not enable cluster mode, i.e., data sharding, this requires using a parameter group that has the parameter cluster-enabled set to true.
I think the issue relates to this dynamic block in the aws_elasticache_replication_group default
resource:
dynamic "cluster_mode" {
for_each = var.cluster_mode_enabled ? ["true"] : []
content {
replicas_per_node_group = var.cluster_mode_replicas_per_node_group
num_node_groups = var.cluster_mode_num_node_groups
}
}
From the explanation in the aws docs, I think this dynamic block should be replaced with the following root level attributes:
num_node_groups = var.cluster_mode_enabled ? var.cluster_mode_num_node_groups : null
replicas_per_node_group = var.cluster_mode_enabled ? var.cluster_mode_replicas_per_node_group : null
Modifying the above locally seems to fix the warning, but further deprecation warnings are raised in the same resource. Fixing each in turn exposes the next one:
replication_group_description -> use description
instead
number_cache_clusters -> use num_cache_clusters instead
Found a bug? Maybe our Slack Community can help.
Describe the Bug
When planning an elasticache redis instance with a cluster_size = 2 and cluster_mode_enabled = false, using v0.42.0, a deprecation warning is issued.
Expected Behavior
No deprecation warnings are issued and a you have a clean plan.
Steps to Reproduce
Steps to reproduce the behavior:
Screenshots
N/A
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Additional Context
N/A