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.
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
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.
Please make sure in the rds database security group inbounded rule your IP is defined for the 5432 port.