databricks.Connection
Explore with Pulumi AI
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:
- Connection
Type string Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- Comment string
Free-form text.
- Metastore
Id string - Name string
Name of the Connection.
- Owner string
Name of the connection owner.
- Properties Dictionary<string, object>
Free-form connection properties.
- Read
Only bool
- Connection
Type string Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- Comment string
Free-form text.
- Metastore
Id string - Name string
Name of the Connection.
- Owner string
Name of the connection owner.
- Properties map[string]interface{}
Free-form connection properties.
- Read
Only bool
- connection
Type String Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- comment String
Free-form text.
- metastore
Id String - name String
Name of the Connection.
- owner String
Name of the connection owner.
- properties Map<String,Object>
Free-form connection properties.
- read
Only Boolean
- connection
Type string Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- comment string
Free-form text.
- metastore
Id string - name string
Name of the Connection.
- owner string
Name of the connection owner.
- properties {[key: string]: any}
Free-form connection properties.
- read
Only boolean
- connection_
type str Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- 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
- connection
Type String Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- comment String
Free-form text.
- metastore
Id String - name String
Name of the Connection.
- owner String
Name of the connection owner.
- properties Map<Any>
Free-form connection properties.
- read
Only 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.
- Comment string
Free-form text.
- Connection
Type string Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
are supported. Up-to-date list of connection type supported- Metastore
Id 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
andpassword
.- Owner string
Name of the connection owner.
- Properties Dictionary<string, object>
Free-form connection properties.
- Read
Only bool
- Comment string
Free-form text.
- Connection
Type string Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
are supported. Up-to-date list of connection type supported- Metastore
Id 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
andpassword
.- Owner string
Name of the connection owner.
- Properties map[string]interface{}
Free-form connection properties.
- Read
Only bool
- comment String
Free-form text.
- connection
Type String Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
are supported. Up-to-date list of connection type supported- metastore
Id 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
andpassword
.- owner String
Name of the connection owner.
- properties Map<String,Object>
Free-form connection properties.
- read
Only Boolean
- comment string
Free-form text.
- connection
Type string Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
are supported. Up-to-date list of connection type supported- metastore
Id 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
andpassword
.- owner string
Name of the connection owner.
- properties {[key: string]: any}
Free-form connection properties.
- read
Only boolean
- comment str
Free-form text.
- connection_
type str Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
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
andpassword
.- owner str
Name of the connection owner.
- properties Mapping[str, Any]
Free-form connection properties.
- read_
only bool
- comment String
Free-form text.
- connection
Type String Connection type.
MYSQL
POSTGRESQL
SNOWFLAKE
REDSHIFT
SQLDW
SQLSERVER
orDATABRICKS
are supported. Up-to-date list of connection type supported- metastore
Id String - name String
Name of the Connection.
- options Map<Any>
The key value of options required by the connection, e.g.
host
,port
,user
andpassword
.- owner String
Name of the connection owner.
- properties Map<Any>
Free-form connection properties.
- read
Only Boolean
Import
This resource can be imported by id
bash
$ 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.