Search in sources :

Example 1 with DeleteAliasRequest

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

the class DeleteAlias method deleteSpecificAlias.

// snippet-start:[kms.java2_delete_alias.main]
public static void deleteSpecificAlias(KmsClient kmsClient, String aliasName) {
    try {
        DeleteAliasRequest deleteAliasRequest = DeleteAliasRequest.builder().aliasName(aliasName).build();
        kmsClient.deleteAlias(deleteAliasRequest);
    } catch (KmsException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : KmsException(software.amazon.awssdk.services.kms.model.KmsException) DeleteAliasRequest(software.amazon.awssdk.services.kms.model.DeleteAliasRequest)

Aggregations

DeleteAliasRequest (software.amazon.awssdk.services.kms.model.DeleteAliasRequest)1 KmsException (software.amazon.awssdk.services.kms.model.KmsException)1