Skip to content

Instantly share code, notes, and snippets.

@donato
Created July 7, 2017 20:33
Show Gist options
  • Save donato/4c6be702e9834c95d578361f773338fe to your computer and use it in GitHub Desktop.
Save donato/4c6be702e9834c95d578361f773338fe to your computer and use it in GitHub Desktop.
Switching between aws environments often?
# 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