5

I have a VPC with two private subnets (two were required to get an RDS instance set up). I have a security group for this VPC, let's call it vpc-sg. vpc-sg allows TCP access on port 22 from my home machine, and allows all outbound traffic. That's it.

I have a public-facing EC2 server launched inside the VPC, that I've attached a public Elastic IP to. I'm using the EIP to ssh into this EC2 server. I set the security group to vpc-sg. I installed PostgreSQL 9.2 on the EC2 instance.

I have an RDS instance within the same VPC. It's using vpc-sg for a security group too. I was forced to pick PostgreSQL version 9.3 when creating the instance. I try accessing the RDS PostgreSQL database from my EC2 instance:

[ec2-user@ip-10-0-0-20 ~]$ psql the_db_name -U the_db_username -h my-db-instance.random-string.us-east-1.rds.amazonaws.com -p 5432 -W
Password for user the_db_username:
psql: could not connect to server: Connection timed out
        Is the server running on host "my-db-instance.random-string.us-east-1.rds.amazonaws.com" (10.0.0.147) and accepting
        TCP/IP connections on port 5432?

What should I be doing?

EDIT -- I am getting the No Inbound Permissions error on RDB, but don't know how to fix it.

  • Have you opened port 5432 on the RDS service? – Drew Khoury Aug 10 '14 at 8:03
  • @DrewKhoury Probably not. How do I do that? – wrongusername Aug 10 '14 at 15:41
  • Just create a new securitygroup with 5432 as inbound TCP connection and replace current security group on your RDS instance with the newly created one. – Chida Aug 10 '14 at 16:08
5

Just create a new securitygroup with 5432 as inbound TCP connection and replace current security group on your RDS instance with the newly created one.

  • 1
    Is the solution still valid in 2014 ? – Dhruba Adhikari Nov 2 '14 at 12:18
  • Nope, doing through this through security groups are "Classic" EC2 now. – dubvfan87 Nov 5 '15 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.