Search in sources :

Example 1 with DeleteHostedZoneRequest

use of software.amazon.awssdk.services.route53.model.DeleteHostedZoneRequest in project aws-doc-sdk-examples by awsdocs.

the class DeleteHostedZone method delHostedZone.

// snippet-start:[route53.java2.delete_hosted_zone.main]
public static void delHostedZone(Route53Client route53Client, String hostedZoneId) {
    try {
        DeleteHostedZoneRequest deleteHostedZoneRequestRequest = DeleteHostedZoneRequest.builder().id(hostedZoneId).build();
        route53Client.deleteHostedZone(deleteHostedZoneRequestRequest);
        System.out.println("The hosted zone was deleted");
    } catch (Route53Exception e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : DeleteHostedZoneRequest(software.amazon.awssdk.services.route53.model.DeleteHostedZoneRequest) Route53Exception(software.amazon.awssdk.services.route53.model.Route53Exception)

Aggregations

DeleteHostedZoneRequest (software.amazon.awssdk.services.route53.model.DeleteHostedZoneRequest)1 Route53Exception (software.amazon.awssdk.services.route53.model.Route53Exception)1