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
feita há 6 meses1996 visualizações
1 Resposta
0
respondido há 6 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas