1. Packages
  2. Databricks
  3. API Docs
  4. Connection
Databricks v1.24.0 published on Wednesday, Sep 27, 2023 by Pulumi

databricks.Connection

Explore with Pulumi AI

databricks logo
Databricks v1.24.0 published on Wednesday, Sep 27, 2023 by Pulumi

    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

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var mysql = new Databricks.Connection("mysql", new()
        {
            Comment = "this is a connection to mysql db",
            ConnectionType = "MYSQL",
            Options = 
            {
                { "host", "test.mysql.database.azure.com" },
                { "password", "password" },
                { "port", "3306" },
                { "user", "user" },
            },
            Properties = 
            {
                { "purpose", "testing" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := databricks.NewConnection(ctx, "mysql", &databricks.ConnectionArgs{
    			Comment:        pulumi.String("this is a connection to mysql db"),
    			ConnectionType: pulumi.String("MYSQL"),
    			Options: pulumi.AnyMap{
    				"host":     pulumi.Any("test.mysql.database.azure.com"),
    				"password": pulumi.Any("password"),
    				"port":     pulumi.Any("3306"),
    				"user":     pulumi.Any("user"),
    			},
    			Properties: pulumi.AnyMap{
    				"purpose": pulumi.Any("testing"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.Connection;
    import com.pulumi.databricks.ConnectionArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var mysql = new Connection("mysql", ConnectionArgs.builder()        
                .comment("this is a connection to mysql db")
                .connectionType("MYSQL")
                .options(Map.ofEntries(
                    Map.entry("host", "test.mysql.database.azure.com"),
                    Map.entry("password", "password"),
                    Map.entry("port", "3306"),
                    Map.entry("user", "user")
                ))
                .properties(Map.of("purpose", "testing"))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_databricks as databricks
    
    mysql = databricks.Connection("mysql",
        comment="this is a connection to mysql db",
        connection_type="MYSQL",
        options={
            "host": "test.mysql.database.azure.com",
            "password": "password",
            "port": "3306",
            "user": "user",
        },
        properties={
            "purpose": "testing",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const mysql = new databricks.Connection("mysql", {
        comment: "this is a connection to mysql db",
        connectionType: "MYSQL",
        options: {
            host: "test.mysql.database.azure.com",
            password: "password",
            port: "3306",
            user: "user",
        },
        properties: {
            purpose: "testing",
        },
    });
    
    resources:
      mysql:
        type: databricks:Connection
        properties:
          comment: this is a connection to mysql db
          connectionType: MYSQL
          options:
            host: test.mysql.database.azure.com
            password: password
            port: '3306'
            user: user
          properties:
            purpose: testing
    

    Create Connection Resource

    new Connection(name: string, args: ConnectionArgs, opts?: CustomResourceOptions);
    @overload
    def Connection(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   comment: Optional[str] = None,
                   connection_type: Optional[str] = None,
                   metastore_id: Optional[str] = None,
                   name: Optional[str] = None,
                   options: Optional[Mapping[str, Any]] = None,
                   owner: Optional[str] = None,
                   properties: Optional[Mapping[str, Any]] = None,
                   read_only: Optional[bool] = None)
    @overload
    def Connection(resource_name: str,
                   args: ConnectionArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewConnection(ctx *Context, name string, args ConnectionArgs, opts ...ResourceOption) (*Connection, error)
    public Connection(string name, ConnectionArgs args, CustomResourceOptions? opts = null)
    public Connection(String name, ConnectionArgs args)
    public Connection(String name, ConnectionArgs args, CustomResourceOptions options)
    
    type: databricks:Connection
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConnectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Connection Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Connection resource accepts the following input properties:

    ConnectionType string

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    Options Dictionary<string, object>

    The key value of options required by the connection, e.g. host, port, user and password.

    Comment string

    Free-form text.

    MetastoreId string
    Name string

    Name of the Connection.

    Owner string

    Name of the connection owner.

    Properties Dictionary<string, object>

    Free-form connection properties.

    ReadOnly bool
    ConnectionType string

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    Options map[string]interface{}

    The key value of options required by the connection, e.g. host, port, user and password.

    Comment string

    Free-form text.

    MetastoreId string
    Name string

    Name of the Connection.

    Owner string

    Name of the connection owner.

    Properties map[string]interface{}

    Free-form connection properties.

    ReadOnly bool
    connectionType String

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    options Map<String,Object>

    The key value of options required by the connection, e.g. host, port, user and password.

    comment String

    Free-form text.

    metastoreId String
    name String

    Name of the Connection.

    owner String

    Name of the connection owner.

    properties Map<String,Object>

    Free-form connection properties.

    readOnly Boolean
    connectionType string

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    options {[key: string]: any}

    The key value of options required by the connection, e.g. host, port, user and password.

    comment string

    Free-form text.

    metastoreId string
    name string

    Name of the Connection.

    owner string

    Name of the connection owner.

    properties {[key: string]: any}

    Free-form connection properties.

    readOnly boolean
    connection_type str

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    options Mapping[str, Any]

    The key value of options required by the connection, e.g. host, port, user and password.

    comment str

    Free-form text.

    metastore_id str
    name str

    Name of the Connection.

    owner str

    Name of the connection owner.

    properties Mapping[str, Any]

    Free-form connection properties.

    read_only bool
    connectionType String

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    options Map<Any>

    The key value of options required by the connection, e.g. host, port, user and password.

    comment String

    Free-form text.

    metastoreId String
    name String

    Name of the Connection.

    owner String

    Name of the connection owner.

    properties Map<Any>

    Free-form connection properties.

    readOnly Boolean

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Connection resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    id string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing Connection Resource

    Get an existing Connection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ConnectionState, opts?: CustomResourceOptions): Connection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            connection_type: Optional[str] = None,
            metastore_id: Optional[str] = None,
            name: Optional[str] = None,
            options: Optional[Mapping[str, Any]] = None,
            owner: Optional[str] = None,
            properties: Optional[Mapping[str, Any]] = None,
            read_only: Optional[bool] = None) -> Connection
    func GetConnection(ctx *Context, name string, id IDInput, state *ConnectionState, opts ...ResourceOption) (*Connection, error)
    public static Connection Get(string name, Input<string> id, ConnectionState? state, CustomResourceOptions? opts = null)
    public static Connection get(String name, Output<String> id, ConnectionState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Comment string

    Free-form text.

    ConnectionType string

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    MetastoreId string
    Name string

    Name of the Connection.

    Options Dictionary<string, object>

    The key value of options required by the connection, e.g. host, port, user and password.

    Owner string

    Name of the connection owner.

    Properties Dictionary<string, object>

    Free-form connection properties.

    ReadOnly bool
    Comment string

    Free-form text.

    ConnectionType string

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    MetastoreId string
    Name string

    Name of the Connection.

    Options map[string]interface{}

    The key value of options required by the connection, e.g. host, port, user and password.

    Owner string

    Name of the connection owner.

    Properties map[string]interface{}

    Free-form connection properties.

    ReadOnly bool
    comment String

    Free-form text.

    connectionType String

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    metastoreId String
    name String

    Name of the Connection.

    options Map<String,Object>

    The key value of options required by the connection, e.g. host, port, user and password.

    owner String

    Name of the connection owner.

    properties Map<String,Object>

    Free-form connection properties.

    readOnly Boolean
    comment string

    Free-form text.

    connectionType string

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    metastoreId string
    name string

    Name of the Connection.

    options {[key: string]: any}

    The key value of options required by the connection, e.g. host, port, user and password.

    owner string

    Name of the connection owner.

    properties {[key: string]: any}

    Free-form connection properties.

    readOnly boolean
    comment str

    Free-form text.

    connection_type str

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    metastore_id str
    name str

    Name of the Connection.

    options Mapping[str, Any]

    The key value of options required by the connection, e.g. host, port, user and password.

    owner str

    Name of the connection owner.

    properties Mapping[str, Any]

    Free-form connection properties.

    read_only bool
    comment String

    Free-form text.

    connectionType String

    Connection type. MYSQL POSTGRESQL SNOWFLAKE REDSHIFT SQLDW SQLSERVER or DATABRICKS are supported. Up-to-date list of connection type supported

    metastoreId String
    name String

    Name of the Connection.

    options Map<Any>

    The key value of options required by the connection, e.g. host, port, user and password.

    owner String

    Name of the connection owner.

    properties Map<Any>

    Free-form connection properties.

    readOnly Boolean

    Import

    This resource can be imported by idbash

     $ pulumi import databricks:index/connection:Connection this '<metastore_id>|<name>'
    

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the databricks Terraform Provider.

    databricks logo
    Databricks v1.24.0 published on Wednesday, Sep 27, 2023 by Pulumi