I’ve now spent far too much time verifying a fucking private key’s fingerprint.
Once upon a time, someone made a server on AWS. When they made that server, they were forced to make a key pair to go along with that server.
Time passed… and the key was forgotten, misplaced, drowned at the bottom of some small lake in the parking lot…
And then one day, much, much later in time, someone had to build another server. And again, they were forced to make a key pair to go along with the new server. But AWS was able to yank up a dirty old parchment that listed the old key pair and the name conflicted with the reasonable name the new key pair should hold.
So, our adventurer spent 4 hours banging his head against some fucking broken documentation and a piece of shit java environment built by someone with a 3rd grade education just so he could yank a few key pairs out of a puddle in the parking lot and see if he could delete the damn things from AWS.
If you try to install the AWS CLI tools (whatever the fuck they’re called these days) and you try to run something like this:
$ ec2-fingerprint-keyAnd you get an error that looks like this:
Exception in thread "main" java.lang.NoClassDefFoundError: com/amazon/aes/webservices/client/cmd/FingerprintKey
Caused by: java.lang.ClassNotFoundException: com.amazon.aes.webservices.client.cmd.FingerprintKeyThen you should probably just ignore all of Amazons shitty documentation and just hammer over to http://clayrichardson.me/log/2013/03/29/brew-install-all-available-aws-tools/ and use Homebrew like a sane person.
Sure, you still have to fuck around with some shit but this is a hell of a lot easier:
brew install auto-scaling aws-cfn-tools aws-elasticache aws-elasticbeanstalk aws-iam-tools aws-sns-cli cloud-watch ec2-ami-tools ec2-api-tools elb-tools rds-command-line-toolsThat page still doesn’t list all the environment variables though. http://kingori.co/minutae/ does though:
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 AWS_AUTO_SCALING_HOME="/usr/local/Cellar/auto-scaling/1.0.61.3/libexec"
export AWS_CLOUDFORMATION_HOME="/usr/local/Cellar/aws-cfn-tools/1.0.12/libexec"
export AWS_CREDENTIAL_FILE="<path to="" the="" credentials="" file="">"
export AWS_ELASTICACHE_HOME="/usr/local/Cellar/aws-elasticache/1.9.000/libexec"
export AWS_ELB_HOME="/usr/local/Cellar/elb-tools/1.0.23.0/libexec"
export EC2_HOME="/usr/local/Cellar/ec2-api-tools/1.6.12.0/libexec"
export AWS_IAM_HOME="/usr/local/opt/aws-iam-tools/jars"
export AWS_CREDENTIAL_FILE=$HOME/.aws-credentials-master
export AWS_SNS_HOME="/usr/local/Cellar/aws-sns-cli/2013-09-27/libexec"
export AWS_CLOUDWATCH_HOME="/usr/local/Cellar/cloud-watch/1.0.13.4/libexec"
export SERVICE_HOME="$AWS_CLOUDWATCH_HOME"
export EC2_AMITOOL_HOME="/usr/local/Cellar/ec2-ami-tools/1.4.0.9/libexec"
export AWS_RDS_HOME="/usr/local/Cellar/rds-command-line-tools/1.14.001/libexec"I hate Amazon’s documentation. It’s one of the reasons I keep my servers over on Rackspace.
