Comments (3)
Ok, thanks for your answer. Unfortunately, it turned out that MongoDB Compass is dumb in that regard - it doesn't check for the environment but simply takes the ACCESS_KEY, etc. as strings via configuration.
For me & especially since I wanted to use a specific role for authentication, the solution was to run aws-vault exec my-profile -- aws sts assume-role --role-arn=my-role-arn --role-session-name=my-role-session
& to open MongoDB Compass with the credentials baked in. This would look like the following, pasting it here in case anyone needs it:
openMongoDbCompassWithRole() {
local output=$(aws-vault exec my-profile -- aws sts assume-role --role-arn=my-role-arn --role-session-name=my-role-session)
AWS_SESSION_TOKEN=$(echo $output | jq -r '.Credentials.SessionToken')
ENCODED_TOKEN=$(node -p "encodeURIComponent(\"${AWS_SESSION_TOKEN}\")")
/Applications/MongoDB\ Compass.app/Contents/MacOS/MongoDB\ Compass \
--username=$(echo $output | jq -r '.Credentials.AccessKeyId') \
--password=$(echo $output | jq -r '.Credentials.SecretAccessKey') \
"mongodb+srv://my.mongodb.com/mydb?authMechanism=MONGODB-AWS&authSource=%24external&authMechanismProperties=AWS_SESSION_TOKEN%3A${ENCODED_TOKEN}" &
}
from aws-vault.
none, and use aws-vault --server
from aws-vault.
Does it work only with temporary credentials?
from aws-vault.
Related Issues (20)
- aws-vault ec2server cannot utilize an instance of aws-vault proxy that is already running on windows HOT 1
- aws-vault not working with eksctl to update the add-ons of AWS EKS cluster HOT 1
- AppleScript Error Message: variable not defined HOT 1
- mfa_process not working on Windows HOT 1
- [Bug] aws-vault wedges on 'dbus-launch', won't even run `aws-vault --help` or `aws-vault --version` HOT 2
- Configure aws-vault to cache role tokens HOT 2
- Embedding aws-vault into a golang-written cli HOT 1
- Sponsorship HOT 1
- Unable to find steps to download for Linux ARM Machines HOT 2
- MFA does not seem to be working when using the login function HOT 2
- Can't use --prompt=terminal with --ec2-server on Linux HOT 2
- ECS Server URI needs to include the `get-credentials` path to support AWS SDK Libraries HOT 1
- Unable to decrypt credentials file when using pass backend HOT 5
- Docs out of date for latest version wrt to ykman HOT 1
- No build since March
- Feature: import from `~/.aws/credentials`
- Error when executing any AWS Vault Command on 7.2.0, in WSL Ubuntu on Windows 11 HOT 1
- mfa_process does not seem to be working with Windows
- Importing aws-vault as a library?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-vault.