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.

3
  • Have you opened port 5432 on the RDS service? Commented Aug 10, 2014 at 8:03
  • @DrewKhoury Probably not. How do I do that? Commented Aug 10, 2014 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. Commented Aug 10, 2014 at 16:08

1 Answer 1

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.

2
  • 1
    Is the solution still valid in 2014 ? Commented Nov 2, 2014 at 12:18
  • Nope, doing through this through security groups are "Classic" EC2 now. Commented Nov 5, 2015 at 19:34

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.