Rotation for Postgres #155
Unanswered
leonardo-yukio
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The provided code (https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSPostgreSQLRotationSingleUser/lambda_function.py) no longer works because the pg library uses async as a method name. However, starting from Python 3.7, async became a reserved keyword in the Python language. This means that any code or library that uses async as a method or variable name is no longer compatible with Python versions 3.7 and above.
The AWS Lambda environment has also deprecated support for older Python versions (like Python 3.6) that allowed async to be used as a method name. As a result, the pg library, which relies on this outdated usage, is incompatible with modern Python versions supported by AWS Lambda.
To resolve this issue, the code needs to be updated to use a library or approach that is compatible with Python 3.7+ and does not rely on async as a method name. Alternatively, you can explore other PostgreSQL libraries like psycopg2 or asyncpg (for asynchronous operations) that are actively maintained and compatible with newer Python versions.
Beta Was this translation helpful? Give feedback.
All reactions