Commits

Ches Martin committed 2c48408

Move AWS credential management to awsenv

Comments (0)

Files changed (3)

.aws/aws-envvars.sh

-# Just source this to set the ENV vars.
-# Set AWS_CREDENTIAL_FILE in ~/.local
-
-if [ -f ~/.aws/ec2/pk-*.pem ]; then
-    export EC2_PRIVATE_KEY="$(/bin/ls $HOME/.aws/ec2/pk-*.pem)"
-fi
-
-if [ -f ~/.aws/ec2/pk-*.pem ]; then
-    export EC2_CERT="$(/bin/ls $HOME/.aws/ec2/cert-*.pem)"
-fi
-
-# pip install awscli -- http://aws.amazon.com/cli/
-if [ -f ~/.aws/awscli.ini ]; then
-    export AWS_CONFIG_FILE="$HOME/.aws/awscli.ini"
-fi
-
-if [[ "$(uname -s)" = "Darwin" ]]; then
-    export EC2_HOME="/usr/local/Library/LinkedKegs/ec2-api-tools/jars"
-    export AWS_IAM_HOME="/usr/local/Cellar/aws-iam-tools/HEAD/jars"
-    export AWS_CLOUDWATCH_HOME="/usr/local/Library/LinkedKegs/cloud-watch/jars"
-    export AWS_AUTO_SCALING_HOME="/usr/local/Library/LinkedKegs/auto-scaling/jars"
-    export AWS_CLOUDFORMATION_HOME="/usr/local/Library/LinkedKegs/aws-cfn-tools/jars"
-fi
-
-export SERVICE_HOME="$AWS_CLOUDWATCH_HOME"
-
+# Just source this to set the ENV vars.
+
+# https://github.com/michaelcontento/awsenv and my fork
+if [ -d ~/.awsenv/bin ]; then
+    export PATH=$PATH:$HOME/.awsenv/bin
+    eval "$(awsenv init -)"
+fi
+
+# pip install awscli -- http://aws.amazon.com/cli/
+if [ -f ~/.aws/awscli.ini ]; then
+    export AWS_CONFIG_FILE="$HOME/.aws/awscli.ini"
+fi
+
+if [[ "$(uname -s)" = "Darwin" ]]; then
+    export EC2_HOME="/usr/local/Library/LinkedKegs/ec2-api-tools/jars"
+    export AWS_IAM_HOME="/usr/local/Cellar/aws-iam-tools/HEAD/jars"
+    export AWS_CLOUDWATCH_HOME="/usr/local/Library/LinkedKegs/cloud-watch/jars"
+    export AWS_AUTO_SCALING_HOME="/usr/local/Library/LinkedKegs/auto-scaling/jars"
+    export AWS_CLOUDFORMATION_HOME="/usr/local/Library/LinkedKegs/aws-cfn-tools/jars"
+fi
+
+export SERVICE_HOME="$AWS_CLOUDWATCH_HOME"
+
 
 export JRUBY_HOME=$HOME/.rvm/rubies/jruby-1.6.7.2
 
-# AWS env vars that the Java API tools want
-[[ -r ~/.aws/aws-envvars.sh ]] && source ~/.aws/aws-envvars.sh
+# AWS credential management and env vars that the Java API tools want
+[[ -r ~/.aws/setup.sh ]] && source ~/.aws/setup.sh
 
 #
 # Memcached