{% if conn_type == "imported" -%}
{{ var_name }} = project.connections.get(name={{ conn_name }})
{%- elif conn_type == "project" -%}
{% if not properties and conn_type != "imported" %}
# NOTE: Connection {{ conn_name }} is missing from the zip file or there was a problem with the connection generation, so properties will be empty
{% endif -%}
{{ var_name }} = project.create_connection(
    name = {{ conn_name }},
    datasource_type = platform.datasources.get(name="{{ datasource_type }}"),
    properties = {
        {% for prop, value in properties.items() %}
        "{{ prop }}": {{ value }},
        {% endfor %}
    }
)
{%- else -%}
{% for prop, value in properties.items() %}
{{ connector_name }}.configuration.connection.{{ prop }} = {{ value }}
{% endfor %}
{%- endif %}
