Skip to content

Instantly share code, notes, and snippets.

@nery
Last active August 29, 2015 14:03
Show Gist options
  • Save nery/dcd7919ca0df78888864 to your computer and use it in GitHub Desktop.
Save nery/dcd7919ca0df78888864 to your computer and use it in GitHub Desktop.
bash script to switch AWS creditials
function awscreds {
## switches between sets of AWS credentials.
## usage: awscreds <environment>
## e.g. awscreds tl
## It is advisable to customize the shell prompt to reflect current credentials.
if ! [[ -n $1 ]]; then
echo "Input is required"
else
case $1 in
yogaglo)
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
;;
tl)
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
;;
bell)
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
;;
*)
echo "\"$1\" is not a valid key set"
esac
fi
}
alias deploy='cd ~/Developer/devops/deployments/app && ls environments'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment