UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

381 lines (380 loc) 14 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * > 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const mysql = new databricks.Connection("mysql", { * name: "mysql_connection", * connectionType: "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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const bigquery = new databricks.Connection("bigquery", { * name: "bq_connection", * connectionType: "BIGQUERY", * comment: "this is a connection to BQ", * options: { * GoogleServiceAccountKeyJson: JSON.stringify({ * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const hms = new databricks.Connection("hms", { * name: "hms-builtin", * connectionType: "HIVE_METASTORE", * comment: "This is a connection to builtin HMS", * options: { * builtin: "true", * }, * }); * ``` * * Create a HTTP connection with bearer token * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const httpBearer = new databricks.Connection("http_bearer", { * name: "http_bearer", * connectionType: "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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const httpOauth = new databricks.Connection("http_oauth", { * name: "http_oauth", * connectionType: "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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const pbi = new databricks.Connection("pbi", { * name: "test-pbi", * connectionType: "POWER_BI", * options: { * authorization_endpoint: "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize", * client_id: "client_id", * client_secret: "client_secret", * }, * }); * ``` * * ## Import * * This resource can be imported by `id`: * * hcl * * import { * * to = databricks_connection.this * * id = "<metastore_id>|<name>" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * bash * * ```sh * $ pulumi import databricks:index/connection:Connection this "<metastore_id>|<name>" * ``` */ export declare class Connection extends pulumi.CustomResource { /** * Get an existing Connection resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ConnectionState, opts?: pulumi.CustomResourceOptions): Connection; /** * Returns true if the given object is an instance of Connection. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Connection; /** * Free-form text. Change forces creation of a new resource. */ readonly comment: pulumi.Output<string | undefined>; /** * Unique ID of the connection. */ readonly connectionId: pulumi.Output<string>; /** * 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. */ readonly connectionType: pulumi.Output<string | undefined>; /** * Time at which this connection was created, in epoch milliseconds. */ readonly createdAt: pulumi.Output<number>; /** * Username of connection creator. */ readonly createdBy: pulumi.Output<string>; /** * The type of credential for this connection. */ readonly credentialType: pulumi.Output<string>; /** * Full name of connection. */ readonly fullName: pulumi.Output<string>; /** * Unique ID of the UC metastore for this connection. */ readonly metastoreId: pulumi.Output<string>; /** * Name of the Connection. */ readonly name: pulumi.Output<string>; /** * The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorizationEndpoint`, `clientId`, `clientSecret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option. */ readonly options: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Name of the connection owner. */ readonly owner: pulumi.Output<string>; /** * Free-form connection properties. Change forces creation of a new resource. */ readonly properties: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Object with the status of an asynchronously provisioned resource. */ readonly provisioningInfos: pulumi.Output<outputs.ConnectionProvisioningInfo[]>; /** * Indicates whether the connection is read-only. Change forces creation of a new resource. */ readonly readOnly: pulumi.Output<boolean>; readonly securableType: pulumi.Output<string>; /** * Time at which connection this was last modified, in epoch milliseconds. */ readonly updatedAt: pulumi.Output<number>; /** * Username of user who last modified the connection. */ readonly updatedBy: pulumi.Output<string>; /** * URL of the remote data source, extracted from options. */ readonly url: pulumi.Output<string>; /** * Create a Connection resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: ConnectionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Connection resources. */ export interface ConnectionState { /** * Free-form text. Change forces creation of a new resource. */ comment?: pulumi.Input<string>; /** * Unique ID of the connection. */ connectionId?: pulumi.Input<string>; /** * 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. */ connectionType?: pulumi.Input<string>; /** * Time at which this connection was created, in epoch milliseconds. */ createdAt?: pulumi.Input<number>; /** * Username of connection creator. */ createdBy?: pulumi.Input<string>; /** * The type of credential for this connection. */ credentialType?: pulumi.Input<string>; /** * Full name of connection. */ fullName?: pulumi.Input<string>; /** * Unique ID of the UC metastore for this connection. */ metastoreId?: pulumi.Input<string>; /** * Name of the Connection. */ name?: pulumi.Input<string>; /** * The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorizationEndpoint`, `clientId`, `clientSecret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option. */ options?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Name of the connection owner. */ owner?: pulumi.Input<string>; /** * Free-form connection properties. Change forces creation of a new resource. */ properties?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Object with the status of an asynchronously provisioned resource. */ provisioningInfos?: pulumi.Input<pulumi.Input<inputs.ConnectionProvisioningInfo>[]>; /** * Indicates whether the connection is read-only. Change forces creation of a new resource. */ readOnly?: pulumi.Input<boolean>; securableType?: pulumi.Input<string>; /** * Time at which connection this was last modified, in epoch milliseconds. */ updatedAt?: pulumi.Input<number>; /** * Username of user who last modified the connection. */ updatedBy?: pulumi.Input<string>; /** * URL of the remote data source, extracted from options. */ url?: pulumi.Input<string>; } /** * The set of arguments for constructing a Connection resource. */ export interface ConnectionArgs { /** * Free-form text. Change forces creation of a new resource. */ comment?: pulumi.Input<string>; /** * 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. */ connectionType?: pulumi.Input<string>; /** * Name of the Connection. */ name?: pulumi.Input<string>; /** * The key value of options required by the connection, e.g. `host`, `port`, `user`, `password`, `authorizationEndpoint`, `clientId`, `clientSecret` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option. */ options?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Name of the connection owner. */ owner?: pulumi.Input<string>; /** * Free-form connection properties. Change forces creation of a new resource. */ properties?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Indicates whether the connection is read-only. Change forces creation of a new resource. */ readOnly?: pulumi.Input<boolean>; }