Laban Bwire
Laban Bwire

Reputation: 93

ETIMEDOUT Error on trying to connect TypeORM with PostgresDB on AWS RDS

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.

Upvotes: 1

Views: 1425

Answers (2)

Laban Bwire
Laban Bwire

Reputation: 93

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

Upvotes: 0

Abhay Kalariya
Abhay Kalariya

Reputation: 1

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

Upvotes: 0

Related Questions