From 07382af161023141173da57f4f58ab30023ce1a0 Mon Sep 17 00:00:00 2001 From: Lance Speelmon Date: Mon, 8 Apr 2013 14:06:13 -0700 Subject: [PATCH] Configures aliases and adds ec2-api-tools directories to environment variables; assumes brew. --- modules/ec2-api-tools/README.md | 14 +++++++++++++ modules/ec2-api-tools/init.zsh | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 modules/ec2-api-tools/README.md create mode 100644 modules/ec2-api-tools/init.zsh diff --git a/modules/ec2-api-tools/README.md b/modules/ec2-api-tools/README.md new file mode 100644 index 00000000..63acc81d --- /dev/null +++ b/modules/ec2-api-tools/README.md @@ -0,0 +1,14 @@ +ec2-api-tools +============= + +Configures aliases and adds ec2-api-tools directories to environment variables. +Assumes brew was used to install ec2-api-tools: ```sudo brew install ec2-api-tools```. + +Authors +------- + +*The authors of this module should be contacted via the [issue tracker][1].* + + - [Lance Speelmon](https://github.com/lancespeelmon) + +[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/ec2-api-tools/init.zsh b/modules/ec2-api-tools/init.zsh new file mode 100644 index 00000000..378b6f06 --- /dev/null +++ b/modules/ec2-api-tools/init.zsh @@ -0,0 +1,36 @@ +# +# Configures aliases and adds ec2-api-tools directories to environment variables. +# Assumes brew was used to install ec2-api-tools: ```sudo brew install ec2-api-tools```. +# +# Authors: +# Lance Speelmon +# + +# Return if requirements are not found. +if [[ "$OSTYPE" != darwin* ]]; then + return 1 +fi + +# +# Environment +# + +# ==> Caveats +# Before you can use these tools you must export some variables to your $SHELL +# and download your X.509 certificate and private key from Amazon Web Services. + +# Your certificate and private key are available at: +# http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key + +# Download two ".pem" files, one starting with `pk-`, and one starting with `cert-`. +# You need to put both into a folder in your home directory, `~/.ec2`. +export JAVA_HOME="$(/usr/libexec/java_home)" +export EC2_PRIVATE_KEY="$(/bin/ls "$HOME"/.ec2/pk-*.pem | /usr/bin/head -1)" +export EC2_CERT="$(/bin/ls "$HOME"/.ec2/cert-*.pem | /usr/bin/head -1)" +export EC2_HOME="/usr/local/Library/LinkedKegs/ec2-api-tools/jars" + +# +# Aliases +# + +alias ii='curl -q http://169.254.169.254/latest/meta-data/instance-id'