Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to override AWS profile by setting #515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,11 @@
"type": "boolean",
"default": false,
"description": "The default behavior is to generate a single ObjectId and insert it on all cursors. Set to true to generate a unique ObjectId per cursor instead."
},
"mdb.AWSProfile": {
"type": "string",
"default": "default",
"description": "The AWS Profile to set. This will allow MONGODB-AWS authentication using a set profile."
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/connectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ export default class ConnectionController {

this._statusView.showMessage('Connecting to MongoDB...');

const awsProfile: string | undefined = vscode.workspace
.getConfiguration('mdb')
.get('AWSProfile');
this._statusView.showMessage(`Using AWS Profile ${awsProfile}`);
process.env.AWS_PROFILE = awsProfile;


const connectionOptions = this._connections[connectionId].connectionOptions;

if (!connectionOptions) {
Expand Down