@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
109 lines • 4.88 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CatalogWorkspaceBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource has been deprecated and will be removed soon. Please use the databricks.WorkspaceBinding resource instead.
*
* If you use workspaces to isolate user data access, you may want to limit catalog access to specific workspaces in your account, also known as workspace-catalog binding
*
* By default, Databricks assigns the catalog to all workspaces attached to the current metastore. By using `databricks.CatalogWorkspaceBinding`, the catalog will be unassigned from all workspaces and only assigned explicitly using this resource.
*
* > To use this resource the catalog must have its isolation mode set to `ISOLATED` in the `databricks.Catalog` resource. Alternatively, the isolation mode can be set using the UI or API by following [this guide](https://docs.databricks.com/data-governance/unity-catalog/create-catalogs.html#configuration).
*
* > If the catalog's isolation mode was set to `ISOLATED` using Pulumi then the catalog will have been automatically bound to the workspace it was created from.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const sandbox = new databricks.Catalog("sandbox", {
* name: "sandbox",
* isolationMode: "ISOLATED",
* });
* const sandboxCatalogWorkspaceBinding = new databricks.CatalogWorkspaceBinding("sandbox", {
* securableName: sandbox.name,
* workspaceId: other.workspaceId,
* });
* ```
*
* ## Import
*
* This resource can be imported by using combination of workspace ID, securable type and name:
*
* hcl
*
* import {
*
* to = databricks_catalog_workspace_binding.this
*
* id = "<workspace_id>|<securable_type>|<securable_name>"
*
* }
*
* Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/catalogWorkspaceBinding:CatalogWorkspaceBinding this "<workspace_id>|<securable_type>|<securable_name>"
* ```
*/
class CatalogWorkspaceBinding extends pulumi.CustomResource {
/**
* Get an existing CatalogWorkspaceBinding 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 CatalogWorkspaceBinding(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CatalogWorkspaceBinding. 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'] === CatalogWorkspaceBinding.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bindingType"] = state?.bindingType;
resourceInputs["catalogName"] = state?.catalogName;
resourceInputs["securableName"] = state?.securableName;
resourceInputs["securableType"] = state?.securableType;
resourceInputs["workspaceId"] = state?.workspaceId;
}
else {
const args = argsOrState;
if (args?.workspaceId === undefined && !opts.urn) {
throw new Error("Missing required property 'workspaceId'");
}
resourceInputs["bindingType"] = args?.bindingType;
resourceInputs["catalogName"] = args?.catalogName;
resourceInputs["securableName"] = args?.securableName;
resourceInputs["securableType"] = args?.securableType;
resourceInputs["workspaceId"] = args?.workspaceId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CatalogWorkspaceBinding.__pulumiType, name, resourceInputs, opts);
}
}
exports.CatalogWorkspaceBinding = CatalogWorkspaceBinding;
/** @internal */
CatalogWorkspaceBinding.__pulumiType = 'databricks:index/catalogWorkspaceBinding:CatalogWorkspaceBinding';
//# sourceMappingURL=catalogWorkspaceBinding.js.map