The Terraform documentation says that the availability_zones attribute of the aws_elasticache_replication_group resource is deprecated and we should use preferred_cache_cluster_azs instead. But when I switch to that it forces a destroy/create on the aws_elasticache_replication_group even though I am not changing the azs. Is there a way to do this without destroying the resource?
ElastiCache replication group preferred_cache_cluster_azs forces destroy and create
Our workaround for this was to remove the aws_elasticache_replication_group from TF state, make main.tf use the preferred_cache_cluster_azs argument instead of availability_zones for the aws_elasticache_replication_group resource and then import the resource back into TF state. After doing this tf apply was clean.