2 Answers
- Newest
- Most votes
- Most comments
1
Hi,
-
Did you check that the TCP port used by your RDS instance matches the one in your Sec Group? If not, you requests will not go through the sec group.
-
Does your RDS instance have a public IP address to access it over the internet from a remote machine ?
Best,
Didier
0
1.As Shown in the rds config screenshot. The port is 5432. In the security group config ss added, 5432 port is added in security groups. Also rds is publicly available
For additional context I am sharing the code here which I use to connect to postgres db
import psycopg2
# Database connection details
db_host = 'my endpoint'
db_port = '5432'
db_name = 'sqltrainingdb'
db_user = 'postgres'
db_password = 'password'
# Establish a connection to the database
conn = psycopg2.connect(
host=db_host,
port=db_port,
dbname=db_name,
user=db_user,
password=db_password
)
conn
And the error I get is
answered 17 days ago
Relevant content
- asked 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
Please check the configs shared below and see if I missed anything
Any update?