Examples of HostedZone


Examples of com.amazonaws.services.route53.model.HostedZone

    public String createZone(Project project, String zone, String topZone, DnsSuffixData suffixData) {
        if (suffixData.getSharedDomain()) {
            log.info("Request to create {} under shared AWS Route 53 domain {}; will reuse", zone, suffixData.getKey());
            return null;
        } else {
            HostedZone hostedZone = client.createHostedZone(topZone);
            return hostedZone.getId();
        }
    }
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

        public Void call() throws CloudException, IOException {
            log.debug("Updating domain: {}", zone.getName());

            List<Recordset> requested = readFromDatabase(false);

            HostedZone hostedZone = getHostedZone();

            List<Recordset> aws = readFromAws(hostedZone);

            Changes changes = computeChanges(aws, requested);

            List<ResourceRecordSet> create = mapToAws(hostedZone.getName(), changes.create);
            List<ResourceRecordSet> remove = mapToAws(hostedZone.getName(), changes.remove);
            client.changeRecords(hostedZone.getId(), create, remove);

            return null;
        }
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

            if (!zoneName.endsWith(".")) {
                zoneName += ".";
            }

            String awsZoneName = client.getAwsZoneName(zoneName);
            HostedZone hostedZone = hostedZones.get(awsZoneName);
            if (hostedZone == null) {
                hostedZone = client.createHostedZone(awsZoneName);
            }
            return hostedZone;
        }
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

        }
        return hostedZones;
    }

    public HostedZone createHostedZone(String zoneName) {
        HostedZone zone = getHostedZones().get(zoneName);
        if (zone != null) {
            return zone;
        }

        log.info("Creating Route 53 zone: {}", zoneName);
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

  public List<String> listZone(final String source) {

    final List<String> nameList = new LinkedList<String>();

    final HostedZone zone = findZone(source);

    if (zone == null) {
      return nameList;
    }

    final ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest();

    request.setHostedZoneId(zone.getId());

    while (true) {

      final ListResourceRecordSetsResult result = amazonClient
          .listResourceRecordSets(request);
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

  }

  public void ensureCNAME(final String source, final String target)
      throws Exception {

    final HostedZone zone = findZone(source);

    Util.assertNotNull(zone, "missing zone for " + source);

    final String zoneId = zone.getId();

    final boolean isPresent;
    final ResourceRecordSet recordOld;
    {
      final ResourceRecordSet recordFound = findRecord(zoneId, source);
      if (recordFound == null) {
        isPresent = false;
        recordOld = makeRecordCNAME(source, target);
      } else {
        isPresent = true;
        recordOld = recordFound;
      }
    }

    final ResourceRecordSet recordNew = makeRecordCNAME(source, target);

    recordNew.setTTL(recordOld.getTTL());

    //

    final Collection<Change> changeList = new LinkedList<Change>();
    if (isPresent) {
      changeList.add(new Change(ChangeAction.DELETE, recordOld));
      changeList.add(new Change(ChangeAction.CREATE, recordNew));
    } else {
      changeList.add(new Change(ChangeAction.CREATE, recordNew));
    }

    final ChangeBatch changeRequest = new ChangeBatch();
    changeRequest.setComment("updated : " + new Date());
    changeRequest.setChanges(changeList);

    final ChangeResourceRecordSetsRequest request = new ChangeResourceRecordSetsRequest();
    request.setHostedZoneId(zone.getId());
    request.setChangeBatch(changeRequest);

    final ChangeResourceRecordSetsResult result = amazonClient
        .changeResourceRecordSets(request);
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

      getLog().info("dns find init [" + dnsHostName + "]");

      final CarrotRoute53 route53 = newRoute53();

      final HostedZone zone = route53.findZone( //
          route53.canonical(dnsHostName));

      final Properties props = project().getProperties();

      final String zoneName;

      if (zone == null) {
        zoneName = null;
        props.remove(dnsResultProperty);
      } else {
        zoneName = zone.getName();
        props.put(dnsResultProperty, zoneName);
      }

      getLog().info("dns zone name : " + zoneName);
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

     */
    {
      for (Entry<String, String> entry : recordsToAssign.entrySet()) {
        String record = entry.getKey();
        String zoneId = entry.getValue();
        HostedZone hostedZone = hostedZoneMapping.get(zoneId);
       
        Validate.notNull(hostedZone, format("Unknown Hosted Zone Id: %s for Record: %s", zoneId, record));
        Validate.isTrue(record.endsWith(hostedZone.getName()), format("Record %s does not map to zoneId %s (domain: %s)", record, zoneId, hostedZone.getName()));
      }
    }

    /**
     * Step #5: Get ELB Hosted Zone Id
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

      getLog().info("dns zone init [" + dnsHostName + "]");

      final Route53 route53 = getRoute53();

      final HostedZone zone = route53.findZone( //
          route53.canonical(dnsHostName));

      if (zone == null) {
        throw new IllegalStateException("can not find zone for "
            + dnsHostName);
      }

      final String dnsResultZoneName = zone.getName();

      getLog().info("dns zone name : " + dnsResultZoneName);

      project.getProperties().put(dnsResultProperty, dnsResultZoneName);
View Full Code Here

Examples of com.amazonaws.services.route53.model.HostedZone

  public List<String> listZone(final String source) {

    final List<String> nameList = new LinkedList<String>();

    final HostedZone zone = findZone(source);

    if (zone == null) {
      return nameList;
    }

    final ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest();

    request.setHostedZoneId(zone.getId());

    while (true) {

      final ListResourceRecordSetsResult result = amazonClient
          .listResourceRecordSets(request);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.