0
votes

I've followed the AWS DocumentDB docs for connecting outside VPC:

  1. I created an EC2 instance in the same security group and VPC as the DocDB cluster
  2. In the security group I opened 22 port access for my IP, and also opened port 27017 for communication inside the security so EC2 instance can SSH tunnel to the DocDB
  3. I ran ssh -f -i "ssh-tunneling-access.pem" -L 27017:{doc-db-cluster}:27017 {ec2-instance-user}@{ec2-instance-dns} -N to open the SSH tunnel
  4. In another terminal I tried to connect using Mongo shell with mongosh "mongodb://{credentials}!@localhost:27017/?tls=true&tlsAllowInvalidHostnames=true&tlsCAFile=rds-combined-ca-bundle.pem"

I got an error "MongoServerSelectionError: read ECONNRESET" I'm running on Windows 11, and my terminal is Powershell Core.

Any ideas what did I miss and/or how to troubleshoot it?