Last active
August 29, 2015 14:03
-
-
Save nery/dcd7919ca0df78888864 to your computer and use it in GitHub Desktop.
bash script to switch AWS creditials
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
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