Skip to content

Support AWS IAM credentials / AWS Credentials providers in the MongoDB connection config #1299

@kriswest

Description

@kriswest

Is your feature request related to a problem? Please describe.

Add support the use of AWS IAM credentials (time-based access, rapid expiration) in MongoDB connections, via an AWS Credential provider (which avoids credentials having to be set in environment variables or config files).

See: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-credential-providers/ for details on Credential Providers.

Describe the solution you'd like
A new dependency on @aws-sdk/credential-providers, a new config property in the schema and a quick check to see if its set before passing in the relevant property to the MongoDB client:

const client = new MongoClient(connectionString, {
      ...options,
      authMechanismProperties: {
        AWS_CREDENTIAL_PROVIDER: fromNodeProviderChain()
      }
    });

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions