1 Answer
- Newest
- Most votes
- Most comments
-1
A few things on top of my head:
- Do you connect with the mongo+srv:// address ? If not, you should and make sure to have open the security group ports on your VPC Private Link (I presume that's what you meant by peering). That way the clients in reply will get both IP address and port to connect to. That's how we do and connection works great
- Did you create a MongoDB user with your EC2 IAM task role ? If not, I'd recommend that over username/password. Checkout in CloudFormation -> Public Extensions -> 3rd Party -> look for MongoDb::Atlas::AwsIamDatabaseUser. Of course, that's if you use CFN.
answered 2 years ago
Yes I connect using mongo+srv:// address.. VPC peering is the latest option looks like but didn't work for me, as I am on the shared cluster. I have enabled all HTTP for my alb. What are the security ports I should enable? Can you share any links or elaborate a bit here?
Relevant content
- asked 2 years ago
- Accepted Answerasked 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Issue with outbound network connection from ec2 instance. I had created VPC endpoints for AWS related services, but for mongo atlas I had to create NAT gateway. With the registration of NAT gateway and allowing all routes in the routing table established mongo atlas connection from private ec2 instance. VPC peering might work, but as I was on shared cluster in mongo it didn't work for me.