Skip to content

Instantly share code, notes, and snippets.

@sobi3ch
Created September 9, 2019 17:10
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 sobi3ch/f9312995e084712c96e4e4b1109ca634 to your computer and use it in GitHub Desktop.
Save sobi3ch/f9312995e084712c96e4e4b1109ca634 to your computer and use it in GitHub Desktop.
After downloading default user accessKeys.csv file from AWS console you can setup default profile with following bash function
aws.setup-credencials ()
{
FILE=$HOME/accessKeys.csv;
if test -f "$FILE"; then
echo "Reading from $FILE";
aws configure set aws_access_key_id $(tail -n1 $HOME/accessKeys.csv | cut -d, -f1);
aws configure set aws_secret_access_key $(tail -n1 $HOME/accessKeys.csv | cut -d, -f2);
else
echo "Missing $FILE";
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment