skip to Main Content

I am getting this error on my console when i try to launch the basic TypeORM project on node.js

Error: connect ETIMEDOUT 13.112.12.202:5432
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) {
  errno: -60,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '13.112.12.202',
  port: 5432
}

My data source file has the following configurations.

DataSource({
    type: "postgres",
    host: "sugar-index-database-1.cxpnplofhv5c.ap-northeast-1.rds.amazonaws.com",
    port: 5432,
    username: "postgres",
    password: "*****",
    database: "sugar-index-database-1",
    synchronize: true,
    logging: false,
    entities: [User],
    migrations: [],
    subscribers: [],
})

Also, my instance is publicly accessible.
And I’ve made inbound and outbound security rules to enable access.
Inbound Rules

I am trying to run the QuickStart to TypeORM while connecting to a PostgreDB instance on AWS.

The Node project needs to start and connect to the DB successfully.

2

Answers


  1. Chosen as BEST ANSWER

    I fixed the problem by creating a new database instance. This time I chose to have the standard create setup where I configure everything instead of the easy create which comes with reconfigurations. Of notable difference, in the standard create I was able to set the database name, whereas in the easy create there was no database name assigned nor was there a way to assign one. enter image description here


  2. Please make sure in the rds database security group inbounded rule your IP is defined for the 5432 port.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search