Why am I getting connection timed out when connecting to AWS Document DB from my local machine with TLS disabled? - aws-documentdb

When utilizing AWS' connection string to connect to my Amazon Document DB instance in Robo3T I'm getting a 'Connection Timed Out' error.
Error connecting to ....cluster-....us-east-1.docdb.amazonaws.com:27017 (123.45.67.89:27017) :: caused by :: Connection timed out :

AWS does not currently support connecting to Document DB from public endpoints when not using SSH.
Connecting from Public Endpoints
You are trying to connect to an Amazon DocumentDB cluster directly
from your laptop or local development machine.
Trying to connect to an Amazon DocumentDB cluster directly from a
public endpoint, such as your laptop or local development machine,
will fail. Amazon DocumentDB is virtual private cloud (VPC)-only and
does not currently support public endpoints. Thus, you can't connect
directly to your Amazon DocumentDB cluster from your laptop or local
development environment outside of your VPC.
To connect to an Amazon DocumentDB cluster from outside an Amazon VPC,
you can use an SSH tunnel. For more information, see Connecting to an
Amazon DocumentDB Cluster from Outside an Amazon VPC. Additionally, if
your development environment is in a different Amazon VPC, you can
also use VPC Peering and connect to your Amazon DocumentDB cluster
from another Amazon VPC in the same region or a different region.
More details here: https://docs.aws.amazon.com/documentdb/latest/developerguide/troubleshooting.connecting.html#troubleshooting.cannot-connect.public-endpoints

Related

Connect to RDS instance with PostgreSQL with AWS Secrets Manager?

I have an RDS instance utilizing PostgreSQL in a VPC. This DB uses Secrets Manager for authentication. I created an EC2 within the same VPC and subnet as my RDS instance. I have attached policies to give full access to my EC2 instance.
I have verified I can access Secrets Manager through this EC2 instance by getting a json response of the secretstring and other details.
I use this information to try and access my aurora-postgresql cluster to no avail. connection timed out.
DB accepts inbound traffic to port 5432.
Any tips on what to diagnose next?

Google Composer / Airflow - connection to MongoDB Atlas

We have an airflow task that adds data to the mongodb server.
We can connect to the mongodb server only behind IP Access or VPC Peering.
We are having issues with VPC Peering, so we thought we can just enable direct IP access between the airflow workers and the mongodb server
Has anyone done that?
If not, do you have another suggestion?

Connect to MongoDB atlas within AWS VPC using AWS MSK connector

I am trying to use MongoDB change stream using Kafka. I chose AWS MSK since my entire infrastructure is within AWS and it will be easy to integrate with other AWS services.
I created an AWS MSK cluster within the VPC and created an AWS MSK connect using mongodb Kafka connector. I am getting the following error (Exception opening socket, connect timed out)
To test whether it has to do with VPC, I gave the public access to MongoDB by whitelisting 0.0.0.0, and then the connector is working fine. So I believe it has something to do with the VPC.
I tried multiple times with AWS MSK with VPC with public subnets, NAT gateway, etc, and it is still not working. Am getting the same error. I believe the AWS MSK connecter uses the same VPC configuration as AWS MSK since there's no separate configuration for AWS MSK Connect.
The answer is to create a Private Endpoint in Atlas then a VPC endpoint in AWS.
There is a section in this guide that explains how to set up the private endpoint: https://www.mongodb.com/developer/languages/java/integrating-mongodb-amazon-apache-kafka/?bpass=true#create-mongodb-atlas-cluster
For me even though we had a peering connection set up between AWS and Atlas with all of the correct routes etc, we still had to go via this private endpoint option, it's a limitation of the MSK I believe

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.
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).

AWS RDS Aurora PostgreSQL serverless: How to set public accessibility to Yes

we have a instance of AWS RDS Aurora PostgreSQL Serverless with a vpc security group associated allowing connections from any place and any port, but we are unable to connect.
we always get the error "could not connect to server: Connection timed out "
We have found references to "public accessibility" parameter to solve the problem, but we are unable to find where to make the change.
Any help?
THanks
Aurora Serverless does not support publicly accessible endpoints at this time. It must be accessed from inside the VPC. Make sure you are attempting to connect to Aurora from within the VPC, and that the security group assigned to the Aurora cluster has the appropriate rules to allow access.