Created
July 7, 2017 20:33
-
-
Save donato/4c6be702e9834c95d578361f773338fe to your computer and use it in GitHub Desktop.
Switching between aws environments often?
This file contains 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
# Given files ~/dev.s3cfg and ~/prd.s3cfg | |
# $swap dev | |
# $swap prd | |
function swap { | |
echo "Setting aws key + secret for s3cmd and aws-cli to $1 ENV" | |
rm -f ~/.s3cfg | |
cp ~/$1.s3cfg ~/.s3cfg | |
rm -rf ~/.aws/ | |
cp -r ~/$1.aws ~/.aws/ | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment