Unable to connect to server: timeout expired AWS aurora rds - amazon-web-services

I am trying to connect my AWS aurora database with pgAdmin 4 and it throws this error. I have tried all the previous solutions provided by the stack overflow answers like add inbound my IP and update pg_hab.conf. It still not working for me. Thank you in advance.
Error facing with pgAdmin

Aurora serverless can be only accessed from within VPC. It has no public Ip address. From docs:
You can't give an Aurora Serverless v1 DB cluster a public IP address. You can access an Aurora Serverless v1 DB cluster only from within a VPC.
This means you either have to connect to it from an EC2 instance running in the same VPC, or setup ssh tunneling or VPN connection between your local computer and the aurora. How to setup ssh tunnel is explained here and here.
Alternatively, use DATA API to interact with your database from outside of a VPC.

Related

Unable to connect to my Aurora PostgreSQL server via pgadmin

I have created a VPC and Aurora PostgreSQL deployed it using CDK, public accessibility has been enabled in the RDS and it is in the Isolated Subnet, when I try to connect it using pgAdmin, it gives a timeout error, even I have changed the Security Group Inbound to Allow All ip's.

AWS RDS connectivity issue

I'm noticing a strange issue connecting to the AWS serverless Aurora endpoint. In our environment, there is an ECS task that creates a DB schema and DB users successfully then there is an application that tries to connect to that same DB and fails.
For some reason, the application that tries to connect to the DB uses an IP address that is not in any CIDR block in the VPC.
VPC's IP CIDR block is 10.100.0.0/16. Serverless RDS cluster uses the subnet present in the VPC (IP range is 10.100.x.x), ECS task and application also uses the same subnet.
java.sql.SQLNonTransientConnectionException: Could not connect to HostAddress{host='dev-db-cluster-serverlessdbcluster-abcd-us-west-2.rds.amazonaws.com', port=3306}. (conn=86949)
Access denied for user 'testservice'#'10.1.6.133'
I'm not able to figure out why an application that uses the same DB host translates the wrong IP 10.1.6.133 and where is this IP coming from.

problems connecting to AWS DocumentDB

I created a Cluster and an Instance of DocumentDB in amazon. When I try to connect to my Local SSH (MacOS) it displays the following message:
When I try for the MongoDB Compass Community:
mongodb://Mobify:<My-Password>#docdb-2019-04-07-23-28-45.cluster-cmffegva7sne.us-east-2.docdb.amazonaws.com:27017/?ssl=true&ssl_ca_certs=rds-combined-ca-bundle.pem&replicaSet=rs0
It loads many minutes and in the end it has this result:
After solving this problem, I would like to know if it is possible to connect a cluster of documentDB to an instance in another zone of availability ... I have my DocumentDB in Ohio and I have an EC2 in São Paulo ... is it possible?
Amazon DocumentDB clusters are deployed in a VPC to provide strong network isolation from the Internet. To connect to your cluster from outside of the VPC, please see the following: https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-from-outside-a-vpc.html
AWS document DB is hosted on a VPC (virtual private cloud) which has its own specific subnets and security groups; basically, anything that resides in a VPC is not publicly accessible.
Document DB is deployed in a VPC. In order to access it, you need to create an EC2 instance or AWS Could9.
Let's access it from the EC2 instance and access AWS document DB using SSH tunneling.
Create an EC2 instance (preferably ubuntu) of any configuration and select the same VPC in which your document DB cluster is hosted.
After the EC2 is completely initialized, start an SSH tunnel and bind the local port # 27017 with document DB cluster host # 27017.
ssh -i "<ec2-private-key>" -L 27017:docdb-2019-04-07-23-28-45.cluster-cmffegva7sne.us-east-2.docdb.amazonaws.com:27017 ubuntu#<ec2-host> -N
Now your localhost is tunneled to ec2 on port 27017. Connect from mongosh or mongo, enter your cluster password and you will be logged in and execute any queries.
mongosh --sslAllowInvalidHostnames --ssl --sslCAFile rds-combined-ca-bundle.pem --username Mobify --password
Note: SSL will be deprecated. Use tls, just replace SSL with tls in the above command.

Connect to Aurora Serverless using EC2 as Proxy

Not a duplicate of AWS Aurora MySQL serverless: how to connect from MySQL Workbench.
Aurora Serverless doesn't support public connections yet.
I used Cloud9 to create an EC2 instance on the same VPN as the database. I then connected to the database from the Cloud9 terminal.
My (GraphQL Prisma) service that I'm attempting to host (on Zeit Now) only takes a HOST and a PASSWORD for configuration.
How can I make the EC2 instance act as a proxy that I can treat exactly as a database endpoint. Can tunneling fully do that and I'm just bad at it?
I think this blog may help you. The idea, is make a forwarding port from ec2-dns:3306 to aurora-serverless-cluster-dns:3306

Cant connect redis-cli with amazon elastic cache

I have created a redis endpoint on amazon elastic cache and also setup vpc & NAT gateway. I need to connect created redis endpoint with redis-cli. i using command like this
redis-cli -h dev-redis.434dffsdsf.0094.ustyue1.cache.amazonaws.com
But i got error message like this
Could not connect to Redis at dev-redis.a35gy4.0001.use1.cache.amazonaws.com:6379: Connection timed out
I tried with several ways
tried to connect from my local ubuntu machine.
tried to connect from a ec2 instance.
My source code is running on aws lambda. Using aws lambda we can successfully connect to the same redis endpoint.
What is the actual issue with my redis client?
Please check SG of ElastiCache. Redis instance should be accessible to server where you're running Redis CLI.
Option 1 will not work, as ElastiCache instances are not accessible outside of their VPC. From the FAQs: "Amazon ElastiCache Nodes, deployed within a VPC, can never be accessed from the Internet or from EC2 Instances outside the VPC."
Option 2 should work, if the EC2 instance is within the same VPC as the ElastiCache instance.
Adding more details as none of the answers here gave me full clarity
What is security group - security group in AWS is like a firewall.
What should I check in the security group - Check in inbound rules of the security group attached to the Redis if port 6379 is open to IPs within the CIDR (e.g. 192.168.32.0/20) of the EC2 instance from which you tried to access the Redis/ElasticCache