@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
147 lines • 6.52 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.Catalog = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Within a metastore, Unity Catalog provides a 3-level namespace for organizing data: Catalogs, Databases (also called Schemas), and Tables / Views.
*
* A `databricks.Catalog` is contained within databricks.Metastore and can contain databricks_schema. By default, Databricks creates `default` schema for every new catalog, but Pulumi plugin is removing this auto-created schema, so that resource destruction could be done in a clean way.
*
* > This resource can only be used with a workspace-level provider!
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const sandbox = new databricks.Catalog("sandbox", {
* name: "sandbox",
* comment: "this catalog is managed by terraform",
* properties: {
* purpose: "testing",
* },
* });
* ```
*
* ## Related Resources
*
* The following resources are used in the same context:
*
* * databricks.getTables data to list tables within Unity Catalog.
* * databricks.getSchemas data to list schemas within Unity Catalog.
* * databricks.getCatalogs data to list catalogs within Unity Catalog.
*
* ## Import
*
* This resource can be imported by name:
*
* hcl
*
* import {
*
* to = databricks_catalog.this
*
* id = "<name>"
*
* }
*
* Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/catalog:Catalog this <name>
* ```
*/
class Catalog extends pulumi.CustomResource {
/**
* Get an existing Catalog 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 Catalog(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Catalog. 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'] === Catalog.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["browseOnly"] = state?.browseOnly;
resourceInputs["catalogType"] = state?.catalogType;
resourceInputs["comment"] = state?.comment;
resourceInputs["connectionName"] = state?.connectionName;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["createdBy"] = state?.createdBy;
resourceInputs["effectivePredictiveOptimizationFlag"] = state?.effectivePredictiveOptimizationFlag;
resourceInputs["enablePredictiveOptimization"] = state?.enablePredictiveOptimization;
resourceInputs["forceDestroy"] = state?.forceDestroy;
resourceInputs["fullName"] = state?.fullName;
resourceInputs["isolationMode"] = state?.isolationMode;
resourceInputs["metastoreId"] = state?.metastoreId;
resourceInputs["name"] = state?.name;
resourceInputs["options"] = state?.options;
resourceInputs["owner"] = state?.owner;
resourceInputs["properties"] = state?.properties;
resourceInputs["providerName"] = state?.providerName;
resourceInputs["provisioningInfo"] = state?.provisioningInfo;
resourceInputs["securableType"] = state?.securableType;
resourceInputs["shareName"] = state?.shareName;
resourceInputs["storageLocation"] = state?.storageLocation;
resourceInputs["storageRoot"] = state?.storageRoot;
resourceInputs["updatedAt"] = state?.updatedAt;
resourceInputs["updatedBy"] = state?.updatedBy;
}
else {
const args = argsOrState;
resourceInputs["browseOnly"] = args?.browseOnly;
resourceInputs["comment"] = args?.comment;
resourceInputs["connectionName"] = args?.connectionName;
resourceInputs["effectivePredictiveOptimizationFlag"] = args?.effectivePredictiveOptimizationFlag;
resourceInputs["enablePredictiveOptimization"] = args?.enablePredictiveOptimization;
resourceInputs["forceDestroy"] = args?.forceDestroy;
resourceInputs["isolationMode"] = args?.isolationMode;
resourceInputs["metastoreId"] = args?.metastoreId;
resourceInputs["name"] = args?.name;
resourceInputs["options"] = args?.options;
resourceInputs["owner"] = args?.owner;
resourceInputs["properties"] = args?.properties;
resourceInputs["providerName"] = args?.providerName;
resourceInputs["provisioningInfo"] = args?.provisioningInfo;
resourceInputs["shareName"] = args?.shareName;
resourceInputs["storageLocation"] = args?.storageLocation;
resourceInputs["storageRoot"] = args?.storageRoot;
resourceInputs["catalogType"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["createdBy"] = undefined /*out*/;
resourceInputs["fullName"] = undefined /*out*/;
resourceInputs["securableType"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["updatedBy"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Catalog.__pulumiType, name, resourceInputs, opts);
}
}
exports.Catalog = Catalog;
/** @internal */
Catalog.__pulumiType = 'databricks:index/catalog:Catalog';
//# sourceMappingURL=catalog.js.map