aws-secrets-manager-rotation-lambdas
aws-secrets-manager-rotation-lambdas copied to clipboard
Feature Request: Support MongoDB version 4.0
Hi,
According to the official document, MongoDB supports 3.2 or 3.4 for both Single User and Master User. I would like to use MongoDB 4.0 to build DocumentDB, So, it would be nice if the lambda to be rotated could also support version 4.0.
Thank you for your feedback. We have noted this as a feature request.
Is there any estimated time for this? It's been a while.
I just tested the current script for the Single rotation scenario and it works for DocumentDB with MongoDB 4.0 compatibility (docdb 4.0.0
)!
I am using pymongo version 3.12.3 (BTW, after a lot of testing, the pymongo version used when set the rotation using the AWS Web Console by the current AWS is 3.2
), but there is an error with pymongo 4+, this is what AWS Lambda shows using that newer version:
[ERROR] TypeError: 'Collection' object is not callable. If you meant to call the 'authenticate' method on a 'Database' object it is failing because no such method exists.
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 77, in lambda_handler
set_secret(service_client, arn, token)
File "/var/task/lambda_function.py", line 158, in set_secret
conn = get_connection(pending_dict)
File "/var/task/lambda_function.py", line 304, in get_connection
conn = connect_and_authenticate(secret_dict, port, dbname, use_ssl)
File "/var/task/lambda_function.py", line 377, in connect_and_authenticate
db.authenticate(secret_dict['username'], secret_dict['password'])
File "/var/task/pymongo/collection.py", line 3164, in __call__
"exists." % self.__name
From this, maybe we should change the title or open a new ticket asking for the support of pymongo 4+
Closing this issue since DocumentDB with MongoDB 4.0 compatibility works with the 3.x recommended version of pymongo. If you have a need for pymongo 4, please open a separate issue indicating the need for this newer library.