def configure_connection_from_properties(instance, name, properties,
    description=None):
    """
    Configures IBM Streams for a connection with a Kafka broker.

    Creates an application configuration object containing the required 
    properties with connection information. The application configuration 
    contains the properties given as key-value pairs in the `properties` 
    dictionary. The keys must be valid 
    `consumer <https://kafka.apache.org/22/documentation/#consumerconfigs>`_ 
    or `producer configurations <https://kafka.apache.org/22/documentation/#producerconfigs>`_.

    Example for creating a configuration for a Streams instance with connection details::

        from streamsx.rest import Instance
        import streamsx.topology.context
        from streamsx.kafka import create_connection_properties, configure_connection
        from icpd_core import icpd_util
        
        cfg = icpd_util.get_service_instance_details(name='your-streams-instance')
        cfg[streamsx.topology.context.ConfigParams.SSL_VERIFY] = False
        instance = Instance.of_service(cfg)
        bootstrap_servers = 'kafka-server-1.domain:9093,kafka-server-2.domain:9093,kafka-server-3.domain:9093'
        consumer_properties = create_connection_properties (bootstrap_servers = bootstrap_servers)
        app_cfg_name = configure_connection_from_properties(instance, 'my_app_cfg1', consumer_properties, 'KafkaConsumerConfig')

    Args:
        instance(streamsx.rest_primitives.Instance): IBM Streams instance object.
        name(str): Name of the application configuration.
        properties(dict): Properties containing valid consumer or producer configurations.
        description(str): Description of the application configuration. If no 
            descrition is given, a description is generated.
    Returns:
        str: Name of the application configuration, i.e. the same value as given in the ``name`` parameter

    .. warning:: The function can be used only in IBM Cloud Pak for Data
    .. versionadded:: 1.3
    """
    if name is None or not isinstance(name, str):
        raise TypeError(name)
    if properties is None or not isinstance(properties, dict):
        raise TypeError(properties)
    _properties = dict()
    for k, v in properties.items():
        _properties[k] = str(v)
    _description = description
    if _description is None:
        _description = 'Kafka configurations'
    app_config = instance.get_application_configurations(name=name)
    if app_config:
        oldProperties = app_config[0].properties
        for key, value in oldProperties.items():
            if not key in _properties:
                _properties[key] = None
        print('update application configuration: ' + name)
        app_config[0].update(_properties)
    else:
        print('create application configuration: ' + name)
        instance.create_application_configuration(name, _properties,
            _description)
    return name
