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

posta 7 mesi fa2048 visualizzazioni
1 Risposta
con risposta 7 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande