class AwsPublicKeyConnector implements PublicKeyConnector {

    @Override
    public void unregister(PublicKeyUnregisterRequest request) {
        LOGGER.debug("Deleting public key {} in {} region on AWS", request.getPublicKeyId(), request.getRegion());
        AwsCredentialView awsCredential = new AwsCredentialView(request.getCredential());
        try {
            AmazonEC2Client client = awsClient.createAccess(awsCredential, request.getRegion());
            DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(request.getPublicKeyId());
            client.deleteKeyPair(deleteKeyPairRequest);
        } catch (Exception e) {
            String errorMessage = String.format("Failed to delete public key [%s: '%s', region: '%s'], detailed message: %s",
                    getType(awsCredential), getAwsId(awsCredential), request.getRegion(), e.getMessage());
            LOGGER.error(errorMessage, e);
        }
    }

    public  AwsPublicKeyConnector(AwsClient awsClient);

}