Netflix / denominator

Portably control DNS clouds using java or bash
Apache License 2.0
580 stars 110 forks source link

support for route53 aliases #245

Closed codefromthecrypt closed 11 years ago

codefromthecrypt commented 11 years ago

This adds support for route53 aliases, a dependency of #244. Aliases look like normal A or AAAA record sets, except that the values are instances of AliasTarget instead of AData or AAAAData.

ex.

ResourceRecordSet.<AliasTarget> builder()//
                .name("fooo.myzone.com.")//
                .type("A")//
                .add(AliasTarget.create("Z3I0BTR7N27QRM", "ipv4-route53recordsetlivetest.adrianc.myzone.com."))//
                .build();

This also adds a cli hook to create ELB aliases, using the --elb-dnsname flag.

Ex.

$ denominator -n route53 record -z myzone.com. add -t A -n foo.myzone.com. --elb-dnsname abadmin-795710131.us-east-1.elb.amazonaws.com
;; in zone myzone.com. adding to rrset foo.myzone.com. A values: [{HostedZoneId=Z3DZXE0Q79N41H, DNSName=abadmin-795710131.us-east-1.elb.amazonaws.com}]
[Route53#listHostedZones] ---> GET https://route53.amazonaws.com/2012-12-12/hostedzone HTTP/1.1
[Route53#listHostedZones] <--- HTTP/1.1 200 OK (623ms)
[Route53#listResourceRecordSets] ---> GET https://route53.amazonaws.com/2012-12-12/hostedzone/Z3I0BTR7N27QRM/rrset?name=foo.myzone.com.&type=A HTTP/1.1
[Route53#listResourceRecordSets] <--- HTTP/1.1 200 OK (161ms)
[Route53#listResourceRecordSets] ---> GET https://route53.amazonaws.com/2012-12-12/hostedzone/Z3I0BTR7N27QRM/rrset?name=foo.myzone.com.&type=A HTTP/1.1
[Route53#listResourceRecordSets] <--- HTTP/1.1 200 OK (146ms)
[Route53#changeResourceRecordSets] ---> POST https://route53.amazonaws.com/2012-12-12/hostedzone/Z3I0BTR7N27QRM/rrset HTTP/1.1
[Route53#changeResourceRecordSets] <--- HTTP/1.1 200 OK (152ms)
;; ok
codefromthecrypt commented 11 years ago

note this now supports read/write.

codefromthecrypt commented 11 years ago

now adds --elb-dnsname flag to the cli.

cloudbees-pull-request-builder commented 11 years ago

denominator-pull-requests #331 SUCCESS This pull request looks good