我正在编写一个 flask 应用程序,它使用 flask-sqlalchemy 库与 AWS RDS 中的 postgres 服务器通信。
该应用程序仅使用用户名和密码即可正常工作。但是我创建了一个 IAM 用户并允许他使用令牌登录到 postgres(使用 boto3 的函数“generate_db_auth_token()”)。使用令牌登录得到以下错误。
'sqlalchemy.exc.OperationalError:(psycopg2.OperationalError)致命:用户“abc”的 PAM 身份验证失败'
这是我使用令牌的 SQLALCHEMY_DATABASE_URI,
"postgresql+psycopg2://"+get_conn()[0]['user']+":"+str(get_conn()[0]['password'])+"@"+get_conn()[0]['host']+":"+str(get_conn()[0]['port'])+"/common?sslmode=verify-ca&sslrootcert=/home/ec2-user/root.pem"
我在这里做错了什么吗?
海绵宝宝撒
温温酱
相关分类