class AwsNetworkConnector implements DefaultNetworkConnector {

    @Override
    public void deleteNetworkWithSubnets(NetworkDeletionRequest networkDeletionRequest) {
        if (!networkDeletionRequest.isExisting()) {
            AwsCredentialView credentialView = new AwsCredentialView(networkDeletionRequest.getCloudCredential());
            AmazonCloudFormationRetryClient cloudFormationRetryClient = getCloudFormationRetryClient(credentialView, networkDeletionRequest.getRegion());
            DeleteStackRequest deleteStackRequest = new DeleteStackRequest();
            String stackName = networkDeletionRequest.getStackName();
            deleteStackRequest.setStackName(stackName);
            cloudFormationRetryClient.deleteStack(deleteStackRequest);
            AmazonCloudFormationClient cfClient = awsClient.createCloudFormationClient(credentialView, networkDeletionRequest.getRegion());
            Waiter<DescribeStacksRequest> deletionWaiter = cfClient.waiters().stackDeleteComplete();
            LOGGER.debug("CloudFormation stack deletion request sent with stack name: '{}' ", stackName);
            DescribeStacksRequest describeStacksRequest = new DescribeStacksRequest().withStackName(stackName);
            run(deletionWaiter, describeStacksRequest, null,
                    String.format("Network delete failed (cloudformation: %s)", stackName),
                    () -> AwsCloudFormationErrorMessageProvider.getErrorReason(cloudFormationRetryClient, stackName, ResourceStatus.DELETE_FAILED));
        }
    }

}