Created
May 19, 2021 14:05
-
-
Save cliv/7c6aa1b1be1503d4bfb892a9607d9267 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to ~/.aws/config and add the path to your folder. | |
[profile vscode] | |
region = us-west-2 | |
credential_process = --YOUR $HOME HERE--/.aws/get_credentials_vscode.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Place in ~/.aws | |
JQ=`which jq` | |
CURL=`which curl` | |
if [ -z "$JQ" ] || [ -z "$CURL" ] | |
then | |
echo "Required programs missing." | |
echo "JQ: $JQ" | |
echo "CURL: $CURL" | |
exit 1 | |
fi | |
$CURL -s http://169.254.169.254/latest/meta-data/iam/security-credentials/{rolename} | $JQ '.Version = 1 | .SessionToken = .Token | del(.Token, .Type, .Code, .LastUpdated)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment