Can someone help me to test psql on dev environment


Can you please let me know how to configure psql host on dev environment, I have tried to configure the same. but while connecting I am getting this error:

How can I configure psql connection to a target host. Please find my requirements:

  • I want to configure a user and allow only psql connection for the same
  • How can I parse username, to boundary connect postgres -target-id ttcp_EKvfirfEKw
    What I want to do is here is to connect to a particular database from boundary user

It would be great if somebody can help with sample config or terraform config

I tried using the below-pasted command but Its getting the below-pasted error. I have confirmed that the psql -hx.x.x.x -p5432 -UJustin is working from where I am running the below-pasted command

root@ip-172-31-16-187:~/boundarytest# boundary connect postgres -target-id ttcp_3ICCBN2VJ1 – -h x.x.x.x -p 5432 -UJustin
Password for user Justin:
psql: error: could not connect to server: could not connect to server: Connection refused
Is the server running on host “” and accepting
TCP/IP connections on port 37581?

Can someone please help me here also, please do let me know why its connecting to a random part

Hi there,

Is your target configuration set to at least two connections? Postgres needs multiple connections to log in via psql. You could try with -1 and see if that helps, then adjust from there.

@jeff Sure I have tried this from my end and but it didnt worked

@SKR24x7 - can you try without the host and port configuration? We override that in the pg call to the boundary host and ephemeral port the session is created on locally.