title: Failed connection to postgres on EC2 only, works on local machine
body: <p>I'm running an application on an EC2 instance (AWS cloud computing solution) that connects to a specific Database address.</p>
  <p>When I run the application in my local machine it connects perfectly to the DB.</p>
  <p>However, when I run it in the EC2 the connection hangs indefinitely. I've also tried to connect using psql to prove that the error was on the connection and received the &quot;Connection timed out error&quot;.</p>
  <p>Both my local machine and the EC2 instance are running ubuntu 22.04.</p>
  <p>Does anyone have any idea what could be going on?</p>