Search in sources :

Example 1 with DeleteServerCertificateRequest

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

the class DeleteServerCertificate method deleteCert.

// snippet-start:[iam.java2.delete_server_certificate.main]
public static void deleteCert(IamClient iam, String certName) {
    try {
        DeleteServerCertificateRequest request = DeleteServerCertificateRequest.builder().serverCertificateName(certName).build();
        iam.deleteServerCertificate(request);
        System.out.println("Successfully deleted server certificate " + certName);
    } catch (IamException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : DeleteServerCertificateRequest(software.amazon.awssdk.services.iam.model.DeleteServerCertificateRequest) IamException(software.amazon.awssdk.services.iam.model.IamException)

Aggregations

DeleteServerCertificateRequest (software.amazon.awssdk.services.iam.model.DeleteServerCertificateRequest)1 IamException (software.amazon.awssdk.services.iam.model.IamException)1