问题
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?
回答1:
Two things to check:
Ensure that the RDS instance has the publicly accessible attribute set so that it is assigned a public address
Also according to the AWS RDS docs, "If you want your DB instance in the VPC to be publicly accessible, you must enable the VPC attributes DNS hostnames and DNS resolution."
Also, check that the IP that your RDS instance hostname resolves to is a public IP address.
回答2:
As per new AWS RDS UI. Follow Following steps.
- Open the Amazon RDS console.
- Choose Databases from the navigation pane, and then select the DB instance.
- Choose Modify.
- Connectivity
Additionally[important]: inbound and outbound policy update with PORT and IPs
来源:https://stackoverflow.com/questions/31867896/aws-rds-public-access