def __init__(self):
logger.debug("Trying to connect...")
self.connection = psycopg2.connect(
host='vvclassroomcluster-instance-1.***removed***.eu-west-2.rds.amazonaws.com',
dbname='vvclassroomdatabase',
user='postgres',
password = anvil.secrets.get_secret('amazon_db_password'),
connect_timeout=10,
cursor_factory=psycopg2.extras.RealDictCursor
)
logger.debug("Connected")
return```
Error:
Trying to create a school...
My IP address is 52.56.203.177
43.876266 [vv_dataobjects.tableutils] Users service not found
43.876401 [vv_dataobjects.tableio] Trying to connect...
OperationalError: timeout expired
at /usr/local/lib/python3.7/site-packages/psycopg2/__init__.py, line 130
called from tableio, line 22
called from School, line 30
called from TestDataObjects, line 13


Allowed all incoming IPs in Amazon security rule and now it works. I guess I don’t have correct egress IP ranges.
1 Like