I use this Terraform example to create an ElastiCache Redis cluster (clustered mode enabled): https://www.terraform.io/docs/providers/aws/r/elasticache_replication_group.html#redis-cluster-mode-enabled
resource "aws_elasticache_replication_group" "example" {
replication_group_id = "example-group"
engine_version = "5.0.5"
node_type = "cache.r5.large"
port = 6379
automatic_failover_enabled = true
cluster_mode {
replicas_per_node_group = 1
num_node_groups = 6
}
}
But how do I specify availability nodes for clusters and replicas? It's possible via AWS console. I was hoping to add availability_zones = ["us-east-1a", "us-east-1c"]
to specify that all master nodes must be in us-east-1a and all replicas in us-east-1c, but got
Error creating Elasticache Replication Group: InvalidParameterCombination: PreferredCacheClusterAZs can only be specified for one node group.
I use Terraform v0.12.17 and aws provider v2.34.0.