run:
terraform init
terraform plan
terraform apply
docker ps
terraform apply -var="mongo_replicas_count=<desired-count>"
terraform apply -var="redis_replicas_count=<desired-count>
mongosh --host localhost --port <desired-port>
redis-cli -h localhost -p <desired-port>
mongosh --host localhost --port <desired-port>
rs.status()
and you should get the following output...
docker exec redis-node-1 redis-cli -a password INFO replication
https://www.mongodb.com/resources/products/compatibilities/deploying-a-mongodb-cluster-with-docker