There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DeleteDomain
with an AWS SDK
The following code examples show how to use DeleteDomain
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:
- SDK for Java 2.x
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. /** * Deletes a specific domain asynchronously. * @param domainName the name of the domain to be deleted * @return a {@link CompletableFuture} that completes when the domain has been deleted * or throws a {@link RuntimeException} if the deletion fails */ public CompletableFuture<DeleteDomainResponse> deleteSpecificDomainAsync(String domainName) { DeleteDomainRequest domainRequest = DeleteDomainRequest.builder() .domainName(domainName) .build(); // Delete domain asynchronously return getAsyncClient().deleteDomain(domainRequest) .whenComplete((response, exception) -> { if (exception != null) { throw new RuntimeException("Failed to delete the domain: " + domainName, exception); } }); }
-
For API details, see DeleteDomain in AWS SDK for Java 2.x API Reference.
-