Reputation: 21
I've created AWS RDS Postgres database and I tried to create a new database server to connect to AWS RDS database from PGadmin4 like so:
However, it throws an error message everytime im trying to create the new server:
What I've done :
One post that had similar issue to mine is unable to connect to AWS RDS postgres instance from pgadmin4. The issue still persists despite having followed the suggested solutions.
Upvotes: 1
Views: 5841
Reputation: 313
This is a common issue beginers face. To resolve this issue folllow the below steps ( Make sure your RDS is publically Accisible)
Create a Two Route Table one for public access and one for Private access.
Create a Nat Gateway Using the Same VPC as used in the RDS instance.
Add the Nat Gateway to the PVT route table with 0.0.0.0/0 ip as showen in the below figure include the subnet in subnet association donot use the subnet of the availability zone of the RDS instance as that subnet will be used in PUBLIC ROUTE TABLE.. So Associate the other subnet to this ROute Table
In the PUBLIC ROUTE TABLE add the following routes for 0.0.0.0/0 usin the internet gate way of your vpc. associate the subnet which belongs to RDS instances availability zone into this route table
Note: Addition to this if you want to add a new Subnet to the RDS instance so that you can add a new subnet at the same availability zone of your RDS you can create a subnet in the same VPC aand add the subnet to (RDS Subnet Group)
To provide internet access to your aws lambda using the same RDS you can just attach the subnet used in private route table to your lambda function.
Upvotes: 0
Reputation: 1208
You can try to debug using the telnet command to know whether the issue is with your connection or with PGAdmin4.
telnet <endpoint> <port>
If the RDS instance is reachable via telnet then your connection is ok, else you need to allow the traffic.
Upvotes: 1