Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
534 views
in Technique[技术] by (71.8m points)

amazon vpc - Mongodb atlas dedicated cluster: how to create peering connection with AWS and then access the cluster without whitelisting ips

We have a dedicated M10 cluster in Mongodb Atlas, on which I have created a peering connection with AWS to incorporate security using VPC. I have followed this Mongodb document for configuring peering connection between AWS and cluster.

https://docs.atlas.mongodb.com/security-vpc-peering/

The peering connection is created successfully and is active now. But the thing is, I am unable to connect to cluster without whitelisting my IP. When I try to connect without whitelisting the IP, it gives below error:

Something went wrong MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/

While after whitelisting the IP, I am able to connect to cluster successfully from local environment. What do I need to access a cluster within VPC using application? I can not use the option IP whitelisting as every user's IP can not be whitelisted.

I have already whitelisted CIDR block as mentioned by the above documentation.

question from:https://stackoverflow.com/questions/65916363/mongodb-atlas-dedicated-cluster-how-to-create-peering-connection-with-aws-and-t

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

IP whitelisting is separate from peering. Peering determines the network, whitelisting determines who on the network is allowed access.

If you want to allow access from anything that has physical connectivity to the database, whitelist the entire world (0.0.0.0/0).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...