Support getting connection provider when connecting with aws authentication
It would be helpful if the connect function would support getting one of "@aws-sdk/credential-providers", in case of AWS authentication.
mongo db driver for node js, checks the credentials in specific order, and gives precedence to env. There is no way to override it.
This causes a problem when running from EKS cluster, and using web identity token file.
When my pod needs to access also other AWS resources like S3, and I expose AWS environment variables (like AWSACCESSKEYID, AWSSECRETACCESSKEY), the MongoDB driver takes into account the credentials before the web identity token, and fails to connect as my pod specific user, can’t access Atlas.
When I don’t expose AWS variables, my pod successfully uses the web identity token and connects to Atals.
). We need a way to tell the driver where to take the credentials from, not relying on default precedence order.