Wednesday, August 17, 2011

min requirements and env for ec2-api-tools

I started a mini Fedora EC2 instance on Amazon Web Services the other day. The instance had a slim set of installed programs. Here is the short list of dependencies to get the ec2-api-tools running:
  • yum install openssh-clients (for SCP)
  • yum install unzip (for the zipped ec2-api-tools install zip)
  • install latest jdk (latest 6_27 from Oracle's site)
As well, ec2-api-tools depends on a a few environment variables..the five lines at the bottom of this .bash_profile:
export PATH
export HADOOP_HOME=/usr/lib/hadoop-0.20
export HIVE_HOME=/usr/lib/hive
export MYBUCKET=frasestrendingtopics
export MYSERVER=localhost
export MAILTO=cacasododom@gmail.com
export JAVA_HOME=/usr/java/jdk1.6.0_24/
export EC2_HOME=/usr/bin/ec2-api-tools-1.4.4.0
export EC2_PRIVATE_KEY=~/doc/software/amazon/certs/pk-GEQDDYWBHKJKKUWNWAS.pem
export EC2_CERT=~/doc/software/amazon/certs/cert-DYWBHKJKKUWNWASYNF2YL.pem
export ACCESS_KEY_ID=8DSRMMTFQMQRER2
export SECRET_ACCESS_KEY=mAq9QzCVhmxzKpxhQxBoA5jOxZksq62jpO5mbD

Cheers..


Friday, August 5, 2011

ec2 api tools through an http proxy

I spent about an hour on this today so I thought it would be reasonable to post about it. I was trying to access the EC2 API tools behind my firewall at work, through our http proxy server. You can get this to work by setting a JVM environment variable called EC2_JVM_ARGS like so. Example is from a Linux box.

Example without username authentication (using ntlmaps)
export EC2_JVM_ARGS="-DproxySet=true -DproxyHost=localhost -DproxyPort=5865 -Dhttps.proxySet=true -Dhttps.proxyHost=localhost -Dhttps.proxyPort=5865"

Example with username authentication
export EC2_JVM_ARGS="-DproxySet=true -DproxyHost=http-proxy -DproxyPort=8080 -Dhttps.proxySet=true -Dhttps.proxyHost=http-proxy -Dhttps.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPass=password -Dhttps.proxyUser=username -Dhttps.proxyPass=password"

Voila..it works!
sodo@linux-z6tw:~> ec2din -v
Setting User-Agent to [ec2-api-tools 1.4.4.0]
Using proxy [http-proxy:8080]
Using proxy credentials [username@password] for all realms
------------------------------[ REQUEST ]-------------------------------
------------------------------------------------------------------------
REQUEST ID 76b60060-790c-403f-b0dd-75d06d7f3a79


Hooray!
sodo

Reference
https://forums.aws.amazon.com/thread.jspa?messageID=52041쭉