Unable to connect AWS RDS to Node Application

0

I made AWS RDS instance made, Publicly accessible "Yes", have default VPC security group, have two imbound rules one default one and one custom rule as below

Name : blank, Security group rule ID : sgr-0d64f2e55ff6cf13d, IP version : IPv4, Type : PostgreSQL, Protocol : TCP, Port range : 5432, Source : 0.0.0.0/0 Description : blank

i'm able to connect using psql but when i try to connect using node & sequelize i get this error

Unable to connect to the database: ConnectionError [SequelizeConnectionError]: no pg_hba.conf entry for host "146.196.32.43", user "abhinay", database "tenant-core", no encryption

same in log: error/postgresql.log.2023-10-27-06

2023-10-27 06:14:42 UTC: 146.196.32.43(58328):abhinay@tenant-core:[8289]:FATAL: no pg_hba.conf entry for host "146.196.32.43", user "abhinay", database "tenant-core", no encryption

node db config

`const { Sequelize } = require("sequelize"); const { PGHOST, PGUSER, PGDATABASE, PGPASSWORD } = require("../../env");

const sequelize = new Sequelize(PGDATABASE, PGUSER, PGPASSWORD, { host: PGHOST, dialect: "postgres", operatorsAliases: 0, logging: false, pool: { max: 5, min: 0, acquire: 30000, idle: 10000, } })

const connectionTest = async () => { try { await sequelize.authenticate(); console.log('Connection has been established successfully.'); } catch (error) { console.error('Unable to connect to the database:', error); } } connectionTest()`

neither I'm able to telnet

Abhinay
已提问 6 个月前1992 查看次数
1 回答
0
已回答 6 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则