connecting AWS RDS postgres with python

Asked

Viewed 41 times

-2

I have a database mounting with the postgres engine in the AWS RDS

I would like to know how to access it through python

import psycopg2
import sys
import boto3

ENDPOINT="endpoint na AWS"
PORT="5432"
USR="usuario_do_banco"
REGION="regiao"
DBNAME="nome do banco"

and then how do I?

1 answer

-3

Hello, The connection is basically a normal connection, Ex:

conn= psycopg2.connect(
host="aquele endereço longo do seu RDS",
database="nome do seu banco", 
user="usuário",
senha="a senha que você criou") 

The important thing in this story is to know if you have release from the Security group to access this bank, by default it assumes the default SG, which does not release almost any origin reach it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.