use of software.amazon.awssdk.services.route53.model.CreateHostedZoneResponse in project aws-doc-sdk-examples by awsdocs.
the class CreateHostedZone method createZone.
// snippet-start:[route53.java2.create_hosted_zone.main]
public static String createZone(Route53Client route53Client, String domainName) {
try {
// You must use a unique CallerReference string every time you submit a CreateHostedZone request
String callerReference = java.util.UUID.randomUUID().toString();
CreateHostedZoneRequest zoneRequest = CreateHostedZoneRequest.builder().callerReference(callerReference).name(domainName).build();
// Create the Hosted Zone
CreateHostedZoneResponse zoneResponse = route53Client.createHostedZone(zoneRequest);
return zoneResponse.hostedZone().id();
} catch (Route53Exception e) {
System.err.println(e.getMessage());
System.exit(1);
}
return "";
}
Aggregations