MongoError: Could not find user "arn:aws:sts::****:assumed-role/test-role/*" for db "$external"

I followed the steps here to setup Unified AWS Access through AWS IAM authentication.

However when I kickoff my lambda I get the following error:

MongoError: Could not find user “arn:aws:sts::***:assumed-role/test-role/” for db “$external”

It seems similar to this issue where its trying to use the STS role instead of the IAM role I registered.

Any ideas what is wrong? I am using the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for username and password, setting the authSource to $external and setting the authMechanism to MONGODB-AWS.


Figured it out. I needed to manually add a database user for the IAM role, something that the documentation does not mention

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.