Skip to content

Instantly share code, notes, and snippets.

@cliv
Created May 19, 2021 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cliv/7c6aa1b1be1503d4bfb892a9607d9267 to your computer and use it in GitHub Desktop.
Save cliv/7c6aa1b1be1503d4bfb892a9607d9267 to your computer and use it in GitHub Desktop.
# 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
#!/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