@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
179 lines • 7.73 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Connection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > 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
*
* ## 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 _this = new databricks.Connection("this", {
* name: "hms-builtin",
* connectionType: "HIVE_METASTORE",
* comment: "This is a connection to builtin HMS",
* options: {
* builtin: "true",
* },
* });
* ```
*
* ## Import
*
* This resource can be imported by `id`:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/connection:Connection this '<metastore_id>|<name>'
* ```
*/
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, id, state, opts) {
return new Connection(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Connection.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["connectionId"] = state ? state.connectionId : undefined;
resourceInputs["connectionType"] = state ? state.connectionType : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["createdBy"] = state ? state.createdBy : undefined;
resourceInputs["credentialType"] = state ? state.credentialType : undefined;
resourceInputs["fullName"] = state ? state.fullName : undefined;
resourceInputs["metastoreId"] = state ? state.metastoreId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["properties"] = state ? state.properties : undefined;
resourceInputs["provisioningInfos"] = state ? state.provisioningInfos : undefined;
resourceInputs["readOnly"] = state ? state.readOnly : undefined;
resourceInputs["securableType"] = state ? state.securableType : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["updatedBy"] = state ? state.updatedBy : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["connectionType"] = args ? args.connectionType : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["options"] = (args === null || args === void 0 ? void 0 : args.options) ? pulumi.secret(args.options) : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["properties"] = args ? args.properties : undefined;
resourceInputs["readOnly"] = args ? args.readOnly : undefined;
resourceInputs["connectionId"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["createdBy"] = undefined /*out*/;
resourceInputs["credentialType"] = undefined /*out*/;
resourceInputs["fullName"] = undefined /*out*/;
resourceInputs["metastoreId"] = undefined /*out*/;
resourceInputs["provisioningInfos"] = undefined /*out*/;
resourceInputs["securableType"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["updatedBy"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["options"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Connection.__pulumiType, name, resourceInputs, opts);
}
}
exports.Connection = Connection;
/** @internal */
Connection.__pulumiType = 'databricks:index/connection:Connection';
//# sourceMappingURL=connection.js.map
;