AWS Elasticache Global Replication group Secondary Cluster setting Auto failover to True

Hello,

I am trying to provision AWS Elasitcache Global Replication group. This is being done in two stages. In the first stage Primary region aws_elasticache_replication_group and Global aws_elasticache_global_replication_group are provisioned. In the second stage secondary region aws_elasticache_replication_group is provisioned and attached to Global Datastore using global_replication_group_id attribute. The secondary region is provisoned and attached to global replication group. However the seconday cluster by default is setting the auto fail over to true. By default this should be false as per documentation. So now if I rerun terraform apply, the secondary cluster tries to change the auto fail over to false which is the correct default value and this causes terraform apply to fail as this can not be modified

module.elasticache_redis_global.aws_elasticache_replication_group.redis_cache_cluster_sec: Modifying… [id=sp360commercial-pdx-dev-test4-redis]

231Error: error updating ElastiCache Replication Group (sp360commercial-pdx-dev-test4-redis): error requesting modification: InvalidParameterValue: Cluster [sp360commercial-pdx-dev-test4-redis] is part of a global cluster [ldgnf-sp360commercial-iad-dev-test4-global]. Request rejected.

232 status code: 400, request id: b15e578b-7906-412f-aef8-1d038c9fbb81

233 on …/…/…/modules/aws/elasticache-global/redis.tf line 1, in resource “aws_elasticache_replication_group” “redis_cache_cluster_sec”:

234 1: resource “aws_elasticache_replication_group” “redis_cache_cluster_sec” {

236Cleaning up file based variables

If I explicitly set auto fail over to true in secondary cluster provisioning, I get an error saying that the auto fail over attribute conflicts with global replication group ID attribute

Error: ConflictsWith

173 on …/…/…/modules/aws/elasticache-global/redis.tf line 4, in resource “aws_elasticache_replication_group” “redis_cache_cluster_sec”:

174 4: global_replication_group_id = “${local.globalstore_prefix}-global”

175"global_replication_group_id": conflicts with automatic_failover_enabled

176Terraform apply is skipped because DISRUPTERRA_DRY_RUN was set to true.

Terraform Version v0.12.24
AWS Provider Version 3.37.0

1 Like

I have this same error. Is there any resolution to this problem?