Heroku static IP addresses and MongoDB Atlas

Hi Everyone

I am using the Swift native driver and Vapor for my web application which is hosted on Heroku. I have been in the development phase using the sandbox cluster but I am now looking to begin Beta testing and I have upgraded my cluster to M2.

I would now like to remove enabling access from anywhere and restrict access to two static IP addresses available from an Heroku add on, having followed the how to blog post: Using MongoDB Atlas on Heroku

However I am getting the following error and I am not sure how to resolve it:

No suitable servers found: `serverSelectionTimeoutMS` expired: [connection closed calling ismaster on 'cluster0-shard-00-00-fzuuk.mongodb.net:27017'] 
[Failed to receive length header from server. calling ismaster on '********************'] 
[Failed to receive length header from server. calling ismaster on '********************']

Any ideas on how I can resolve this?

What is the danger of making my MongoDB Atlas cluster available to be accessed from any IP Address?

Thanks
Piers

The danger of any IP address is low as long as you have an appropriately strong database credential and governance around the database credential management (consider MongoDB Atlas- Database - Secrets Engines | Vault | HashiCorp Developer for example).

But if you’re connecting from a static IP address then that should be all you need on the Atlas IP Access List: are you sure you have the public IP added?

-Andrew