0

I have two EC2 instances running at the moment. One of them is Postgres server and the other is NodeJS app that should connect to postgres database. It seems that connection can't be established (however I can't ping postgres instance from app instance (I used instance public IP as destination)). I guess the issue is firewall related. How can I set to have access from one instance to another?

2
  • Have you checked your Security Groups on your instances? Commented Sep 18, 2017 at 15:39
  • You need to use the private IP, not the public IP, and you need to open the port in the Security Group assigned tot he Postgres instance. Commented Sep 18, 2017 at 16:02

1 Answer 1

1

This is most probably an issue with the Security Group configuration. Select the EC2 instance used for Postgres in AWS Web Console and select the Security Group attached. After selecting the security group, then grant inbound access for the Postgres port (5432).

Apart from that, you cannot ping to EC2 instances unless the ICMP port is not open again in the Security Groups.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.