Netflix/denominator — pull request #74 by adriancole (2013-03-08 20:48:14+00:00)
Title: issue #23: add ec2 shortcuts to supply A or CNAME record data from instance metadata

issue #23: add ec2 shortcuts to supply A or CNAME record data from instance metadata

Here's example usage. Never mind that I didn't authorize my IAM role to actually create the records :)

```
$ ssh 75.101.168.33 ./denominator -p route53 record -z myzone.com. add -n wonky.myzone.com. -t A --ec2-public-ipv4
;; in zone myzone.com. adding to rrset wonky.myzone.com. A values: [{address=75.101.168.33}]
;; error: User: arn:aws:sts::993194456877:federated-user/i-94f9f4e7 is not authorized to perform: route53:ChangeResourceRecordSets on resource: arn:aws:route53:::hostedzone/Z3I0BTR7N27QRM
$ ssh 75.101.168.33 ./denominator -p route53 record -z myzone.com. add -n wonky.myzone.com. -t CNAME --ec2-public-hostname
;; in zone myzone.com. adding to rrset wonky.myzone.com. CNAME values: [{cname=ec2-75-101-168-33.compute-1.amazonaws.com}]
;; error: User: arn:aws:sts::993194456877:federated-user/i-94f9f4e7 is not authorized to perform: route53:ChangeResourceRecordSets on resource: arn:aws:route53:::hostedzone/Z3I0BTR7N27QRM
$ ssh 75.101.168.33 ./denominator -p route53 record -z myzone.com. add -n wonky.myzone.com. -t A --ec2-private-ipv4
;; error: Found unexpected parameters: [--ec2-private-ipv4]
$ ssh 75.101.168.33 ./denominator -p route53 record -z myzone.com. add -n wonky.myzone.com. -t A --ec2-local-ipv4
;; in zone myzone.com. adding to rrset wonky.myzone.com. A values: [{address=10.245.193.130}]
;; error: User: arn:aws:sts::993194456877:federated-user/i-94f9f4e7 is not authorized to perform: route53:ChangeResourceRecordSets on resource: arn:aws:route53:::hostedzone/Z3I0BTR7N27QRM
$ ssh 75.101.168.33 ./denominator -p route53 record -z myzone.com. add -n wonky.myzone.com. -t CNAME --ec2-local-hostname
;; in zone myzone.com. adding to rrset wonky.myzone.com. CNAME values: [{cname=ip-10-245-193-130.ec2.internal}]
;; error: User: arn:aws:sts::993194456877:federated-user/i-94f9f4e7 is not authorized to perform: route53:ChangeResourceRecordSets on resource: arn:aws:route53:::hostedzone/Z3I0BTR7N27QRM
```