Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement record add/remove for route53 #33

Closed
codefromthecrypt opened this issue Mar 4, 2013 · 0 comments
Closed

implement record add/remove for route53 #33

codefromthecrypt opened this issue Mar 4, 2013 · 0 comments

Comments

@codefromthecrypt
Copy link
Contributor

Here's code to add a record to a set.

ResourceRecordSet toAdd = ResourceRecordSet.builder().name("www.denominator.io.").type("A").add("1.1.1.1").build();
Change creating = resourceRecordSetApi.create(toAdd);

// replace below with your favorite polling loop, or.. just let it ride
checkState(Predicates2.retry(new Predicate<Change>() {
         public boolean apply(Change input) {
            return route53Api.getChange(input.getId()).getStatus() == INSYNC;
         }
      }, 600, 1, 5, SECONDS).apply(creating), "%s never synced!", creating);

same process to remove, except s/resourceRecordSetApi.create/resourceRecordSetApi.delete, and you could get a null change if the record was already removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant