how to handle ever-changing password in sqlalchemy+psycopg2?
I inherited some code that uses sqlalchemy with psycopg2, which needs to run on AWS. RDS Postgres supports iam-based authentication, but the way it does it is rather kludgy: you request a temporary password using the AWS RDS API, which is good for about 15 minutes, and you pass that as the password. The code I have effectively does e = create_engine(make_sqlalchemy_string()) , where make_sqlalchemy_string() makes an aws api call, gets the temporary password, and everything is good for a while. Except something, somewhere in the sqlalchemy code closes the connection, and then the password is no