I have a number of Amazon EC2 instances, all running Ubuntu, which I'd like to configure to use Amazon's Route 53.
I setup a script, following Shlomo Swidler's article, but ran into script-related issues, which were answered here. Now, I have the script working, but the only CNAMES being added to Route 53 by the script are the Amazon instance IDs (i-abcd1234.mydomain.com).
According to Swidler's article, the script allows Route 53 to pickup a "ShortName" tag, giving each instance a "friendly" CNAME. I have ShortName tags added to all my instances, but they haven't been picked up by Route 53.
Here's my script:
#!/bin/tcsh -f
set root=`dirname $0`
setenv EC2_HOME /usr/lib/ec2-api-tools
setenv EC2_CERT /etc/cron.route53/ec2_x509_cert.pem
setenv EC2_PRIVATE_KEY /etc/cron.route53/ec2_x509_private.pem
setenv AWS_ACCESS_KEY_ID myaccesskeyid
setenv AWS_SECRET_ACCESS_KEY myaccesskey
/usr/bin/ec2-describe-instances | \
perl -ne '/^INSTANCE\s+(i-\S+).*?(\S+\.amazonaws\.com)/ \
and do { $dns = $2; print "$1 $dns\n" }; /^TAG.+\sShortName\s+(\S+)/ \
and print "$1 $dns\n"' | \
perl -ane 'print "$F[0] CNAME $F[1] --replace\n"' | \
xargs -n 4 /etc/cron.route53/cli53/cli53.py \
rrcreate -x 60 mydomain.com
Has anyone else tried this? What could be preventing Route 53 from picking up the "ShortName" tags?