Following this tutorial, I set up an Aurora PostgreSQL database. I then tried to access the database from my computer using pgAdmin. However, pgAdmin gives the error: "Unable to connect to server: timeout expired"
I have tried the following things:
- Ensured that the database is set to be publicly accessible
- Verified that the database has an IP address (I ran nslookup on my local machine, and it returned a public IP address).
- Verified that the database is in a public subnet (it is launched in two subnets, one of which is a public subnet with an Elastic IP address and one of which is a private subnet which directs traffic to a NAT gateway)
- Ensured that my database is configured to use port 5432
- Modified the security group to add inbound rules allowing TCP traffic on port 5432 from any IPv4 or IPv6 address
- Ensured that I can send outbound traffic on port 5432 from my computer using this site
CodePudding user response:
It looks like you have deployed the Aurora DB cluster into two subnets of a VPC and the problem is that one subnet is public, while the other is private. I suspect the DB will be accessible publicly as long as the public DNS resolves to the DB instance in the public subnet, but will be unreachable when it resolves to the instance in the private subnet (though I have not verified this).
To correct this and make the cluster publicly accessible, deploy the DB into public subnets only.