Issue connecting to postgres rds db

I am setting up bors-ng to run in Docker using the prebuilt Docker image on dockerhub using the instructions here - Setting up bors with docker-compose

When my application is starting up I’m getting

[error] Postgrex.Protocol (#PID<0.2027.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (<db host url>:5432): timeout

This is the first time I am trying this and not sure if I am missing some params in connection url or any env variable

DATABASE_URL: postgresql://<user>:<secret>@<db host url (without https)>:5432/bors_ng

The rds db has been created a long time back so not sure if need to change any setting for tcp connection.

hello @hgdoe! Where I work we have been using bors in a dockerized setup with AWS Postgres RDS without issues for years. In your case, the timeout error makes me suspect you might be missing a network rule to allow traffic from the bors container to the RDS instance

Hello @unicolet! Thanks for your response. I will check the network rules for our RDS instance. Do you remember any special rule you had to set somewhere in your rds instance to allow traffic from bors container?

In our case we allowed only TCP traffic over port 5432 from the security group of the instance(s) running bors. I suppose it's the same or similar for you, depending on how you run bors (on a plain EC2 instance, or in ECS, EKS, etc)

Thanks @unicolet! I think that might be missing from our security groups, I will try that.