Skip to content

Instantly share code, notes, and snippets.

@bartimaeus
Created July 30, 2011 14:05
Show Gist options
  • Save bartimaeus/1115559 to your computer and use it in GitHub Desktop.
Save bartimaeus/1115559 to your computer and use it in GitHub Desktop.
Manage Multiple EC2 Accounts
# Custom bash scripts
export PATH=$PATH:~/bin
# AWS Settings
export AWS_HOME=~/.aws
export EC2_HOME=$AWS_HOME/cli_tools/ec2-api-tools
export AWS_AUTO_SCALING_HOME=$AWS_HOME/cli_tools/as-api-tools
export PATH=$PATH:$EC2_HOME/bin:$AWS_AUTO_SCALING_HOME/bin
export EC2_PRIVATE_KEY=$AWS_HOME/pk-ec2.pem
export EC2_CERT=$AWS_HOME/cert-ec2.pem
export AWS_CREDENTIAL_FILE=$AWS_HOME/credentials
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home/
.DS_Store
cli_tools/
#!/bin/sh
if [[ "cd ~/.aws | git branch | grep $1" = *$1 ]]; then
cd ~/.aws && git checkout $1 | cd -
echo "Ready to Manage $1!"
else
echo "$1 is not a valid ec2 branch"
fi
source ~/.bash_profile
AWSAccessKeyId=xxxxxxxxxxxxxxxxxxxx
AWSSecretKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@bartimaeus
Copy link
Author

Check out my blog post to understand why all of these files are in here: http://blog.webdesignbakery.com/manage-multiple-aws-accounts-and-command-line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment