Unable to connect AWS RDS to Node Application


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 : 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 "", user "abhinay", database "tenant-core", no encryption

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

2023-10-27 06:14:42 UTC:[8289]:FATAL: no pg_hba.conf entry for host "", 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

preguntada hace 7 meses2039 visualizaciones
1 Respuesta
respondido hace 7 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas