# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = ['ConnectionArgs', 'Connection']

@pulumi.input_type
class ConnectionArgs:
    def __init__(__self__, *,
                 comment: Optional[pulumi.Input[_builtins.str]] = None,
                 connection_type: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 owner: Optional[pulumi.Input[_builtins.str]] = None,
                 properties: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 provider_config: Optional[pulumi.Input['ConnectionProviderConfigArgs']] = None,
                 read_only: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        The set of arguments for constructing a Connection resource.
        :param pulumi.Input[_builtins.str] comment: Free-form text. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] connection_type: Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] name: Name of the Connection.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] options: The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        :param pulumi.Input[_builtins.str] owner: Name of the connection owner.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] properties: Free-form connection properties. Change forces creation of a new resource.
        :param pulumi.Input['ConnectionProviderConfigArgs'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[_builtins.bool] read_only: Indicates whether the connection is read-only. Change forces creation of a new resource.
        """
        if comment is not None:
            pulumi.set(__self__, "comment", comment)
        if connection_type is not None:
            pulumi.set(__self__, "connection_type", connection_type)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if options is not None:
            pulumi.set(__self__, "options", options)
        if owner is not None:
            pulumi.set(__self__, "owner", owner)
        if properties is not None:
            pulumi.set(__self__, "properties", properties)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if read_only is not None:
            pulumi.set(__self__, "read_only", read_only)

    @_builtins.property
    @pulumi.getter
    def comment(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Free-form text. Change forces creation of a new resource.
        """
        return pulumi.get(self, "comment")

    @comment.setter
    def comment(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "comment", value)

    @_builtins.property
    @pulumi.getter(name="connectionType")
    def connection_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        """
        return pulumi.get(self, "connection_type")

    @connection_type.setter
    def connection_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "connection_type", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the Connection.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter
    def options(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
        """
        The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        """
        return pulumi.get(self, "options")

    @options.setter
    def options(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "options", value)

    @_builtins.property
    @pulumi.getter
    def owner(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the connection owner.
        """
        return pulumi.get(self, "owner")

    @owner.setter
    def owner(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "owner", value)

    @_builtins.property
    @pulumi.getter
    def properties(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
        """
        Free-form connection properties. Change forces creation of a new resource.
        """
        return pulumi.get(self, "properties")

    @properties.setter
    def properties(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "properties", value)

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['ConnectionProviderConfigArgs']]:
        """
        Configure the provider for management through account provider. This block consists of the following fields:
        """
        return pulumi.get(self, "provider_config")

    @provider_config.setter
    def provider_config(self, value: Optional[pulumi.Input['ConnectionProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="readOnly")
    def read_only(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Indicates whether the connection is read-only. Change forces creation of a new resource.
        """
        return pulumi.get(self, "read_only")

    @read_only.setter
    def read_only(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "read_only", value)


@pulumi.input_type
class _ConnectionState:
    def __init__(__self__, *,
                 comment: Optional[pulumi.Input[_builtins.str]] = None,
                 connection_id: Optional[pulumi.Input[_builtins.str]] = None,
                 connection_type: Optional[pulumi.Input[_builtins.str]] = None,
                 created_at: Optional[pulumi.Input[_builtins.int]] = None,
                 created_by: Optional[pulumi.Input[_builtins.str]] = None,
                 credential_type: Optional[pulumi.Input[_builtins.str]] = None,
                 full_name: Optional[pulumi.Input[_builtins.str]] = None,
                 metastore_id: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 owner: Optional[pulumi.Input[_builtins.str]] = None,
                 properties: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 provider_config: Optional[pulumi.Input['ConnectionProviderConfigArgs']] = None,
                 provisioning_infos: Optional[pulumi.Input[Sequence[pulumi.Input['ConnectionProvisioningInfoArgs']]]] = None,
                 read_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 securable_type: Optional[pulumi.Input[_builtins.str]] = None,
                 updated_at: Optional[pulumi.Input[_builtins.int]] = None,
                 updated_by: Optional[pulumi.Input[_builtins.str]] = None,
                 url: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering Connection resources.
        :param pulumi.Input[_builtins.str] comment: Free-form text. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] connection_id: Unique ID of the connection.
        :param pulumi.Input[_builtins.str] connection_type: Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        :param pulumi.Input[_builtins.int] created_at: Time at which this connection was created, in epoch milliseconds.
        :param pulumi.Input[_builtins.str] created_by: Username of connection creator.
        :param pulumi.Input[_builtins.str] credential_type: The type of credential for this connection.
        :param pulumi.Input[_builtins.str] full_name: Full name of connection.
        :param pulumi.Input[_builtins.str] metastore_id: Unique ID of the UC metastore for this connection.
        :param pulumi.Input[_builtins.str] name: Name of the Connection.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] options: The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        :param pulumi.Input[_builtins.str] owner: Name of the connection owner.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] properties: Free-form connection properties. Change forces creation of a new resource.
        :param pulumi.Input['ConnectionProviderConfigArgs'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[Sequence[pulumi.Input['ConnectionProvisioningInfoArgs']]] provisioning_infos: Object with the status of an asynchronously provisioned resource.
        :param pulumi.Input[_builtins.bool] read_only: Indicates whether the connection is read-only. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.int] updated_at: Time at which connection this was last modified, in epoch milliseconds.
        :param pulumi.Input[_builtins.str] updated_by: Username of user who last modified the connection.
        :param pulumi.Input[_builtins.str] url: URL of the remote data source, extracted from options.
        """
        if comment is not None:
            pulumi.set(__self__, "comment", comment)
        if connection_id is not None:
            pulumi.set(__self__, "connection_id", connection_id)
        if connection_type is not None:
            pulumi.set(__self__, "connection_type", connection_type)
        if created_at is not None:
            pulumi.set(__self__, "created_at", created_at)
        if created_by is not None:
            pulumi.set(__self__, "created_by", created_by)
        if credential_type is not None:
            pulumi.set(__self__, "credential_type", credential_type)
        if full_name is not None:
            pulumi.set(__self__, "full_name", full_name)
        if metastore_id is not None:
            pulumi.set(__self__, "metastore_id", metastore_id)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if options is not None:
            pulumi.set(__self__, "options", options)
        if owner is not None:
            pulumi.set(__self__, "owner", owner)
        if properties is not None:
            pulumi.set(__self__, "properties", properties)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if provisioning_infos is not None:
            pulumi.set(__self__, "provisioning_infos", provisioning_infos)
        if read_only is not None:
            pulumi.set(__self__, "read_only", read_only)
        if securable_type is not None:
            pulumi.set(__self__, "securable_type", securable_type)
        if updated_at is not None:
            pulumi.set(__self__, "updated_at", updated_at)
        if updated_by is not None:
            pulumi.set(__self__, "updated_by", updated_by)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @_builtins.property
    @pulumi.getter
    def comment(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Free-form text. Change forces creation of a new resource.
        """
        return pulumi.get(self, "comment")

    @comment.setter
    def comment(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "comment", value)

    @_builtins.property
    @pulumi.getter(name="connectionId")
    def connection_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Unique ID of the connection.
        """
        return pulumi.get(self, "connection_id")

    @connection_id.setter
    def connection_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "connection_id", value)

    @_builtins.property
    @pulumi.getter(name="connectionType")
    def connection_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        """
        return pulumi.get(self, "connection_type")

    @connection_type.setter
    def connection_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "connection_type", value)

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        Time at which this connection was created, in epoch milliseconds.
        """
        return pulumi.get(self, "created_at")

    @created_at.setter
    def created_at(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "created_at", value)

    @_builtins.property
    @pulumi.getter(name="createdBy")
    def created_by(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Username of connection creator.
        """
        return pulumi.get(self, "created_by")

    @created_by.setter
    def created_by(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "created_by", value)

    @_builtins.property
    @pulumi.getter(name="credentialType")
    def credential_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The type of credential for this connection.
        """
        return pulumi.get(self, "credential_type")

    @credential_type.setter
    def credential_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "credential_type", value)

    @_builtins.property
    @pulumi.getter(name="fullName")
    def full_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Full name of connection.
        """
        return pulumi.get(self, "full_name")

    @full_name.setter
    def full_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "full_name", value)

    @_builtins.property
    @pulumi.getter(name="metastoreId")
    def metastore_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Unique ID of the UC metastore for this connection.
        """
        return pulumi.get(self, "metastore_id")

    @metastore_id.setter
    def metastore_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "metastore_id", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the Connection.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter
    def options(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
        """
        The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        """
        return pulumi.get(self, "options")

    @options.setter
    def options(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "options", value)

    @_builtins.property
    @pulumi.getter
    def owner(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the connection owner.
        """
        return pulumi.get(self, "owner")

    @owner.setter
    def owner(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "owner", value)

    @_builtins.property
    @pulumi.getter
    def properties(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
        """
        Free-form connection properties. Change forces creation of a new resource.
        """
        return pulumi.get(self, "properties")

    @properties.setter
    def properties(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "properties", value)

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['ConnectionProviderConfigArgs']]:
        """
        Configure the provider for management through account provider. This block consists of the following fields:
        """
        return pulumi.get(self, "provider_config")

    @provider_config.setter
    def provider_config(self, value: Optional[pulumi.Input['ConnectionProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="provisioningInfos")
    def provisioning_infos(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ConnectionProvisioningInfoArgs']]]]:
        """
        Object with the status of an asynchronously provisioned resource.
        """
        return pulumi.get(self, "provisioning_infos")

    @provisioning_infos.setter
    def provisioning_infos(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ConnectionProvisioningInfoArgs']]]]):
        pulumi.set(self, "provisioning_infos", value)

    @_builtins.property
    @pulumi.getter(name="readOnly")
    def read_only(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Indicates whether the connection is read-only. Change forces creation of a new resource.
        """
        return pulumi.get(self, "read_only")

    @read_only.setter
    def read_only(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "read_only", value)

    @_builtins.property
    @pulumi.getter(name="securableType")
    def securable_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "securable_type")

    @securable_type.setter
    def securable_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "securable_type", value)

    @_builtins.property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        Time at which connection this was last modified, in epoch milliseconds.
        """
        return pulumi.get(self, "updated_at")

    @updated_at.setter
    def updated_at(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "updated_at", value)

    @_builtins.property
    @pulumi.getter(name="updatedBy")
    def updated_by(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Username of user who last modified the connection.
        """
        return pulumi.get(self, "updated_by")

    @updated_by.setter
    def updated_by(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "updated_by", value)

    @_builtins.property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        URL of the remote data source, extracted from options.
        """
        return pulumi.get(self, "url")

    @url.setter
    def url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "url", value)


@pulumi.type_token("databricks:index/connection:Connection")
class Connection(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 comment: Optional[pulumi.Input[_builtins.str]] = None,
                 connection_type: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 owner: Optional[pulumi.Input[_builtins.str]] = None,
                 properties: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 provider_config: Optional[pulumi.Input[Union['ConnectionProviderConfigArgs', 'ConnectionProviderConfigArgsDict']]] = None,
                 read_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 __props__=None):
        """
        > This resource can only be used with a workspace-level provider!

        Lakehouse Federation is the query federation platform for Databricks. Databricks uses Unity Catalog to manage query federation. To make a dataset available for read-only querying using Lakehouse Federation, you create the following:

        - A connection, a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system.
        - A foreign catalog

        This resource manages connections in Unity Catalog. Please note that OAuth U2M is not supported as it requires user interaction for authentication.

        ## Example Usage

        Create a connection to a MySQL database

        ```python
        import pulumi
        import pulumi_databricks as databricks

        mysql = databricks.Connection("mysql",
            name="mysql_connection",
            connection_type="MYSQL",
            comment="this is a connection to mysql db",
            options={
                "host": "test.mysql.database.azure.com",
                "port": "3306",
                "user": "user",
                "password": "password",
            },
            properties={
                "purpose": "testing",
            })
        ```

        Create a connection to a BigQuery database

        ```python
        import pulumi
        import json
        import pulumi_databricks as databricks

        bigquery = databricks.Connection("bigquery",
            name="bq_connection",
            connection_type="BIGQUERY",
            comment="this is a connection to BQ",
            options={
                "GoogleServiceAccountKeyJson": json.dumps({
                    "type": "service_account",
                    "project_id": "PROJECT_ID",
                    "private_key_id": "KEY_ID",
                    "private_key": \"\"\"-----BEGIN PRIVATE KEY-----
        PRIVATE_KEY
        -----END PRIVATE KEY-----
        \"\"\",
                    "client_email": "SERVICE_ACCOUNT_EMAIL",
                    "client_id": "CLIENT_ID",
                    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
                    "token_uri": "https://accounts.google.com/o/oauth2/token",
                    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
                    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/SERVICE_ACCOUNT_EMAIL",
                    "universe_domain": "googleapis.com",
                }),
            },
            properties={
                "purpose": "testing",
            })
        ```

        Create a connection to builtin Hive Metastore

        ```python
        import pulumi
        import pulumi_databricks as databricks

        hms = databricks.Connection("hms",
            name="hms-builtin",
            connection_type="HIVE_METASTORE",
            comment="This is a connection to builtin HMS",
            options={
                "builtin": "true",
            })
        ```

        Create a HTTP connection with bearer token

        ```python
        import pulumi
        import pulumi_databricks as databricks

        http_bearer = databricks.Connection("http_bearer",
            name="http_bearer",
            connection_type="HTTP",
            comment="This is a connection to a HTTP service",
            options={
                "host": "https://example.com",
                "port": "8433",
                "base_path": "/api/",
                "bearer_token": "bearer_token",
            })
        ```

        Create a HTTP connection with OAuth M2M

        ```python
        import pulumi
        import pulumi_databricks as databricks

        http_oauth = databricks.Connection("http_oauth",
            name="http_oauth",
            connection_type="HTTP",
            comment="This is a connection to a HTTP service",
            options={
                "host": "https://example.com",
                "port": "8433",
                "base_path": "/api/",
                "client_id": "client_id",
                "client_secret": "client_secret",
                "oauth_scope": "channels:read channels:history chat:write",
                "token_endpoint": "https://authorization-server.com/oauth/token",
            })
        ```

        Create a PowerBI connection with OAuth M2M

        ```python
        import pulumi
        import pulumi_databricks as databricks

        pbi = databricks.Connection("pbi",
            name="test-pbi",
            connection_type="POWER_BI",
            options={
                "authorization_endpoint": "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize",
                "client_id": "client_id",
                "client_secret": "client_secret",
            })
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] comment: Free-form text. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] connection_type: Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] name: Name of the Connection.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] options: The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        :param pulumi.Input[_builtins.str] owner: Name of the connection owner.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] properties: Free-form connection properties. Change forces creation of a new resource.
        :param pulumi.Input[Union['ConnectionProviderConfigArgs', 'ConnectionProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[_builtins.bool] read_only: Indicates whether the connection is read-only. Change forces creation of a new resource.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[ConnectionArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        > This resource can only be used with a workspace-level provider!

        Lakehouse Federation is the query federation platform for Databricks. Databricks uses Unity Catalog to manage query federation. To make a dataset available for read-only querying using Lakehouse Federation, you create the following:

        - A connection, a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system.
        - A foreign catalog

        This resource manages connections in Unity Catalog. Please note that OAuth U2M is not supported as it requires user interaction for authentication.

        ## Example Usage

        Create a connection to a MySQL database

        ```python
        import pulumi
        import pulumi_databricks as databricks

        mysql = databricks.Connection("mysql",
            name="mysql_connection",
            connection_type="MYSQL",
            comment="this is a connection to mysql db",
            options={
                "host": "test.mysql.database.azure.com",
                "port": "3306",
                "user": "user",
                "password": "password",
            },
            properties={
                "purpose": "testing",
            })
        ```

        Create a connection to a BigQuery database

        ```python
        import pulumi
        import json
        import pulumi_databricks as databricks

        bigquery = databricks.Connection("bigquery",
            name="bq_connection",
            connection_type="BIGQUERY",
            comment="this is a connection to BQ",
            options={
                "GoogleServiceAccountKeyJson": json.dumps({
                    "type": "service_account",
                    "project_id": "PROJECT_ID",
                    "private_key_id": "KEY_ID",
                    "private_key": \"\"\"-----BEGIN PRIVATE KEY-----
        PRIVATE_KEY
        -----END PRIVATE KEY-----
        \"\"\",
                    "client_email": "SERVICE_ACCOUNT_EMAIL",
                    "client_id": "CLIENT_ID",
                    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
                    "token_uri": "https://accounts.google.com/o/oauth2/token",
                    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
                    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/SERVICE_ACCOUNT_EMAIL",
                    "universe_domain": "googleapis.com",
                }),
            },
            properties={
                "purpose": "testing",
            })
        ```

        Create a connection to builtin Hive Metastore

        ```python
        import pulumi
        import pulumi_databricks as databricks

        hms = databricks.Connection("hms",
            name="hms-builtin",
            connection_type="HIVE_METASTORE",
            comment="This is a connection to builtin HMS",
            options={
                "builtin": "true",
            })
        ```

        Create a HTTP connection with bearer token

        ```python
        import pulumi
        import pulumi_databricks as databricks

        http_bearer = databricks.Connection("http_bearer",
            name="http_bearer",
            connection_type="HTTP",
            comment="This is a connection to a HTTP service",
            options={
                "host": "https://example.com",
                "port": "8433",
                "base_path": "/api/",
                "bearer_token": "bearer_token",
            })
        ```

        Create a HTTP connection with OAuth M2M

        ```python
        import pulumi
        import pulumi_databricks as databricks

        http_oauth = databricks.Connection("http_oauth",
            name="http_oauth",
            connection_type="HTTP",
            comment="This is a connection to a HTTP service",
            options={
                "host": "https://example.com",
                "port": "8433",
                "base_path": "/api/",
                "client_id": "client_id",
                "client_secret": "client_secret",
                "oauth_scope": "channels:read channels:history chat:write",
                "token_endpoint": "https://authorization-server.com/oauth/token",
            })
        ```

        Create a PowerBI connection with OAuth M2M

        ```python
        import pulumi
        import pulumi_databricks as databricks

        pbi = databricks.Connection("pbi",
            name="test-pbi",
            connection_type="POWER_BI",
            options={
                "authorization_endpoint": "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize",
                "client_id": "client_id",
                "client_secret": "client_secret",
            })
        ```

        :param str resource_name: The name of the resource.
        :param ConnectionArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(ConnectionArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 comment: Optional[pulumi.Input[_builtins.str]] = None,
                 connection_type: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 owner: Optional[pulumi.Input[_builtins.str]] = None,
                 properties: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 provider_config: Optional[pulumi.Input[Union['ConnectionProviderConfigArgs', 'ConnectionProviderConfigArgsDict']]] = None,
                 read_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ConnectionArgs.__new__(ConnectionArgs)

            __props__.__dict__["comment"] = comment
            __props__.__dict__["connection_type"] = connection_type
            __props__.__dict__["name"] = name
            __props__.__dict__["options"] = None if options is None else pulumi.Output.secret(options)
            __props__.__dict__["owner"] = owner
            __props__.__dict__["properties"] = properties
            __props__.__dict__["provider_config"] = provider_config
            __props__.__dict__["read_only"] = read_only
            __props__.__dict__["connection_id"] = None
            __props__.__dict__["created_at"] = None
            __props__.__dict__["created_by"] = None
            __props__.__dict__["credential_type"] = None
            __props__.__dict__["full_name"] = None
            __props__.__dict__["metastore_id"] = None
            __props__.__dict__["provisioning_infos"] = None
            __props__.__dict__["securable_type"] = None
            __props__.__dict__["updated_at"] = None
            __props__.__dict__["updated_by"] = None
            __props__.__dict__["url"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["options"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(Connection, __self__).__init__(
            'databricks:index/connection:Connection',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            comment: Optional[pulumi.Input[_builtins.str]] = None,
            connection_id: Optional[pulumi.Input[_builtins.str]] = None,
            connection_type: Optional[pulumi.Input[_builtins.str]] = None,
            created_at: Optional[pulumi.Input[_builtins.int]] = None,
            created_by: Optional[pulumi.Input[_builtins.str]] = None,
            credential_type: Optional[pulumi.Input[_builtins.str]] = None,
            full_name: Optional[pulumi.Input[_builtins.str]] = None,
            metastore_id: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            options: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
            owner: Optional[pulumi.Input[_builtins.str]] = None,
            properties: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
            provider_config: Optional[pulumi.Input[Union['ConnectionProviderConfigArgs', 'ConnectionProviderConfigArgsDict']]] = None,
            provisioning_infos: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ConnectionProvisioningInfoArgs', 'ConnectionProvisioningInfoArgsDict']]]]] = None,
            read_only: Optional[pulumi.Input[_builtins.bool]] = None,
            securable_type: Optional[pulumi.Input[_builtins.str]] = None,
            updated_at: Optional[pulumi.Input[_builtins.int]] = None,
            updated_by: Optional[pulumi.Input[_builtins.str]] = None,
            url: Optional[pulumi.Input[_builtins.str]] = None) -> 'Connection':
        """
        Get an existing Connection resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] comment: Free-form text. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] connection_id: Unique ID of the connection.
        :param pulumi.Input[_builtins.str] connection_type: Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        :param pulumi.Input[_builtins.int] created_at: Time at which this connection was created, in epoch milliseconds.
        :param pulumi.Input[_builtins.str] created_by: Username of connection creator.
        :param pulumi.Input[_builtins.str] credential_type: The type of credential for this connection.
        :param pulumi.Input[_builtins.str] full_name: Full name of connection.
        :param pulumi.Input[_builtins.str] metastore_id: Unique ID of the UC metastore for this connection.
        :param pulumi.Input[_builtins.str] name: Name of the Connection.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] options: The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        :param pulumi.Input[_builtins.str] owner: Name of the connection owner.
        :param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] properties: Free-form connection properties. Change forces creation of a new resource.
        :param pulumi.Input[Union['ConnectionProviderConfigArgs', 'ConnectionProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[Sequence[pulumi.Input[Union['ConnectionProvisioningInfoArgs', 'ConnectionProvisioningInfoArgsDict']]]] provisioning_infos: Object with the status of an asynchronously provisioned resource.
        :param pulumi.Input[_builtins.bool] read_only: Indicates whether the connection is read-only. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.int] updated_at: Time at which connection this was last modified, in epoch milliseconds.
        :param pulumi.Input[_builtins.str] updated_by: Username of user who last modified the connection.
        :param pulumi.Input[_builtins.str] url: URL of the remote data source, extracted from options.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ConnectionState.__new__(_ConnectionState)

        __props__.__dict__["comment"] = comment
        __props__.__dict__["connection_id"] = connection_id
        __props__.__dict__["connection_type"] = connection_type
        __props__.__dict__["created_at"] = created_at
        __props__.__dict__["created_by"] = created_by
        __props__.__dict__["credential_type"] = credential_type
        __props__.__dict__["full_name"] = full_name
        __props__.__dict__["metastore_id"] = metastore_id
        __props__.__dict__["name"] = name
        __props__.__dict__["options"] = options
        __props__.__dict__["owner"] = owner
        __props__.__dict__["properties"] = properties
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["provisioning_infos"] = provisioning_infos
        __props__.__dict__["read_only"] = read_only
        __props__.__dict__["securable_type"] = securable_type
        __props__.__dict__["updated_at"] = updated_at
        __props__.__dict__["updated_by"] = updated_by
        __props__.__dict__["url"] = url
        return Connection(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def comment(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Free-form text. Change forces creation of a new resource.
        """
        return pulumi.get(self, "comment")

    @_builtins.property
    @pulumi.getter(name="connectionId")
    def connection_id(self) -> pulumi.Output[_builtins.str]:
        """
        Unique ID of the connection.
        """
        return pulumi.get(self, "connection_id")

    @_builtins.property
    @pulumi.getter(name="connectionType")
    def connection_type(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Connection type. `MYSQL`, `POSTGRESQL`, `SNOWFLAKE`, `REDSHIFT` `SQLDW`, `SQLSERVER`, `DATABRICKS`, `SALESFORCE`, `BIGQUERY`, `WORKDAY_RAAS`, `HIVE_METASTORE`, `GA4_RAW_DATA`, `SERVICENOW`, `SALESFORCE_DATA_CLOUD`, `GLUE`, `ORACLE`, `TERADATA`, `HTTP` or `POWER_BI` are supported. Up-to-date list of connection type supported is in the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources). Change forces creation of a new resource.
        """
        return pulumi.get(self, "connection_type")

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> pulumi.Output[_builtins.int]:
        """
        Time at which this connection was created, in epoch milliseconds.
        """
        return pulumi.get(self, "created_at")

    @_builtins.property
    @pulumi.getter(name="createdBy")
    def created_by(self) -> pulumi.Output[_builtins.str]:
        """
        Username of connection creator.
        """
        return pulumi.get(self, "created_by")

    @_builtins.property
    @pulumi.getter(name="credentialType")
    def credential_type(self) -> pulumi.Output[_builtins.str]:
        """
        The type of credential for this connection.
        """
        return pulumi.get(self, "credential_type")

    @_builtins.property
    @pulumi.getter(name="fullName")
    def full_name(self) -> pulumi.Output[_builtins.str]:
        """
        Full name of connection.
        """
        return pulumi.get(self, "full_name")

    @_builtins.property
    @pulumi.getter(name="metastoreId")
    def metastore_id(self) -> pulumi.Output[_builtins.str]:
        """
        Unique ID of the UC metastore for this connection.
        """
        return pulumi.get(self, "metastore_id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        Name of the Connection.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def options(self) -> pulumi.Output[Optional[Mapping[str, _builtins.str]]]:
        """
        The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorization_endpoint`, `client_id`, `client_secret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
        """
        return pulumi.get(self, "options")

    @_builtins.property
    @pulumi.getter
    def owner(self) -> pulumi.Output[_builtins.str]:
        """
        Name of the connection owner.
        """
        return pulumi.get(self, "owner")

    @_builtins.property
    @pulumi.getter
    def properties(self) -> pulumi.Output[Optional[Mapping[str, _builtins.str]]]:
        """
        Free-form connection properties. Change forces creation of a new resource.
        """
        return pulumi.get(self, "properties")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> pulumi.Output[Optional['outputs.ConnectionProviderConfig']]:
        """
        Configure the provider for management through account provider. This block consists of the following fields:
        """
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter(name="provisioningInfos")
    def provisioning_infos(self) -> pulumi.Output[Sequence['outputs.ConnectionProvisioningInfo']]:
        """
        Object with the status of an asynchronously provisioned resource.
        """
        return pulumi.get(self, "provisioning_infos")

    @_builtins.property
    @pulumi.getter(name="readOnly")
    def read_only(self) -> pulumi.Output[_builtins.bool]:
        """
        Indicates whether the connection is read-only. Change forces creation of a new resource.
        """
        return pulumi.get(self, "read_only")

    @_builtins.property
    @pulumi.getter(name="securableType")
    def securable_type(self) -> pulumi.Output[_builtins.str]:
        return pulumi.get(self, "securable_type")

    @_builtins.property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> pulumi.Output[_builtins.int]:
        """
        Time at which connection this was last modified, in epoch milliseconds.
        """
        return pulumi.get(self, "updated_at")

    @_builtins.property
    @pulumi.getter(name="updatedBy")
    def updated_by(self) -> pulumi.Output[_builtins.str]:
        """
        Username of user who last modified the connection.
        """
        return pulumi.get(self, "updated_by")

    @_builtins.property
    @pulumi.getter
    def url(self) -> pulumi.Output[_builtins.str]:
        """
        URL of the remote data source, extracted from options.
        """
        return pulumi.get(self, "url")

