TL;DR
DocumentDB in another region <-------- ec2 instance in another region
access
So AWS has launched MongoDB as a service and calls it DocumentDB.
Currently the supported regions are:
1. N. Virginia
2. Ohio
3. Oregon
4. Ireland
So according to their documentation, to access the documentDB:
To interact with your Amazon DocumentDB cluster, you must launch an Amazon Elastic Compute Cloud (Amazon EC2) instance into your default VPC, in the same AWS Region where you created your Amazon DocumentDB cluster.
I did this and it works as expected.
The problem is, how do I access this from another ec2 instance on another VPC, security group and another region.
I tried to access it and this was the exception:
pymongo.errors.ServerSelectionTimeoutError: ....
[Errno 113] No route to host
Note: The above works if I launch an ec2 instance within the same region and same security group.
Is there something I can do to whitelist the ec2 instance in another region using firewall settings?
No route to host
implies more things missing than just firewall settings (which should result inConnection timed out
). Are the VPCs peered? – Conquer