Created
July 30, 2011 14:05
-
-
Save bartimaeus/1115559 to your computer and use it in GitHub Desktop.
Manage Multiple EC2 Accounts
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
# 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/ |
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
.DS_Store | |
cli_tools/ |
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
#!/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 |
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
AWSAccessKeyId=xxxxxxxxxxxxxxxxxxxx | |
AWSSecretKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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