@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
92 lines • 4.97 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.WorkspaceBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource can only be used with a workspace-level provider!
*
* If you use workspaces to isolate user data access, you may want to limit access to catalog, external locations or storage credentials from specific workspaces in your account, also known as workspace binding
*
* By default, Databricks assigns the securable to all workspaces attached to the current metastore. By using `databricks.WorkspaceBinding`, the securable will be unassigned from all workspaces and only assigned explicitly using this resource.
*
* > To use this resource the securable must have its isolation mode set to `ISOLATED` (for databricks_catalog) or `ISOLATION_MODE_ISOLATED` (for (for databricks_external_location, databricks.StorageCredential or databricks_credential) for the `isolationMode` attribute. 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), [this guide](https://docs.databricks.com/en/connect/unity-catalog/external-locations.html#workspace-binding) or [this guide](https://docs.databricks.com/en/connect/unity-catalog/storage-credentials.html#optional-assign-a-storage-credential-to-specific-workspaces).
*
* > If the securable's isolation mode was set to `ISOLATED` using Pulumi then the securable 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 sandboxWorkspaceBinding = new databricks.WorkspaceBinding("sandbox", {
* securableName: sandbox.name,
* workspaceId: other.workspaceId,
* });
* ```
*
* ## Import
*
* This resource can be imported by using combination of workspace ID, securable type and name:
*
* ```sh
* $ pulumi import databricks:index/workspaceBinding:WorkspaceBinding this "<workspace_id>|<securable_type>|<securable_name>"
* ```
*/
class WorkspaceBinding extends pulumi.CustomResource {
/**
* Get an existing WorkspaceBinding 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 WorkspaceBinding(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of WorkspaceBinding. 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'] === WorkspaceBinding.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bindingType"] = state ? state.bindingType : undefined;
resourceInputs["catalogName"] = state ? state.catalogName : undefined;
resourceInputs["securableName"] = state ? state.securableName : undefined;
resourceInputs["securableType"] = state ? state.securableType : undefined;
resourceInputs["workspaceId"] = state ? state.workspaceId : undefined;
}
else {
const args = argsOrState;
resourceInputs["bindingType"] = args ? args.bindingType : undefined;
resourceInputs["catalogName"] = args ? args.catalogName : undefined;
resourceInputs["securableName"] = args ? args.securableName : undefined;
resourceInputs["securableType"] = args ? args.securableType : undefined;
resourceInputs["workspaceId"] = args ? args.workspaceId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(WorkspaceBinding.__pulumiType, name, resourceInputs, opts);
}
}
exports.WorkspaceBinding = WorkspaceBinding;
/** @internal */
WorkspaceBinding.__pulumiType = 'databricks:index/workspaceBinding:WorkspaceBinding';
//# sourceMappingURL=workspaceBinding.js.map
;