Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1609

Add support for AWS_PROFILE when authMechanism is MONGODB-AWS

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      User voice report (link)

      Currently, when using MONGODB-AWS, it can only read the following variables:

      AWS ACCESS KEY ID
      AWS SECRET ACCESS KEY
      AWS SESSION TOKEN

      which forces you to export credentials or to paste them in the CLI.

      AWS has a variable called AWS_PROFILE that will fetch the required values from your credential file, without having to paste them again. This variable is supported by anything using AWS SDK, so mongosh should have support for it as well.

       

      Potential solution #1

      1. If user has already set / has explicitly provided `AWS ACCESS KEY ID`, `AWS SECRET ACCESS KEY`, `AWS SESSION TOKEN` variables, we could use that to auth (current behavior)
      2. Otherwise we can check AWS_PROFILE variable to extract the user's desired profile and parse the info from either ~/.aws/credentials, ~/.aws/config, or allow users to specify where their aws creds file is located

      Potential solution #2

      Create another parameter for authMechanism, something like `authMechanism=MONGODB-AWS-PROFILE` to evoke connecting with AWS_PROFILE

       

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            gaurab.aryal@mongodb.com Gaurab Aryal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: