I am stumped with AWS configuration. My goal is to create a database that's accessible from inside and outside the network.
Here is what I have. RDS instance runs postgresql. Connections from inside the VPC work correctly.
The endpoint is set up to be publicly accessible - and when accessed from the outside, does in fact resolve. However, the connection hangs, indicating the traffic is blocked by somebody.
Security group is good:
Inbound: Port 5432 from 0.0.0.0/0
Outbound: all from 0.0.0.0/0
Subnets. I assume that's where something is wrong, right? At first I had two private and two public subnets in the subnet group. To simplify, I removed the private ones without changing the outcome.
So we have two public subnets:
Both have the same route table with an Internet Gateway
As far as I can tell, everything is in working order... So who is blocking my database connection?
By default, even you have set "Public accessibility" to "Yes" during the setup of RDS, the "Security Group" still not allowing the port 3306 yet.
Therefore you have to click on the Security Group of the RDS, then add a Rule to allow 3306 from anywhere IP.
Here is the reference setting. But here I have to warn you first, this public accessibility would expose your database to the internet. Please do at your own risk.