@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
116 lines • 4.91 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.Schema = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource can only be used with a workspace-level provider!
*
* Within a metastore, Unity Catalog provides a 3-level namespace for organizing data: Catalogs, Databases (also called Schemas), and Tables / Views.
*
* A `databricks.Schema` is contained within databricks.Catalog and can contain tables & views.
*
* ## 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",
* },
* });
* const things = new databricks.Schema("things", {
* catalogName: sandbox.id,
* name: "things",
* comment: "this database is managed by terraform",
* properties: {
* kind: "various",
* },
* });
* ```
*
* ## 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 its full name:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/schema:Schema this <catalog_name>.<name>
* ```
*/
class Schema extends pulumi.CustomResource {
/**
* Get an existing Schema 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 Schema(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Schema. 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'] === Schema.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["catalogName"] = state ? state.catalogName : undefined;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["enablePredictiveOptimization"] = state ? state.enablePredictiveOptimization : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["metastoreId"] = state ? state.metastoreId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["properties"] = state ? state.properties : undefined;
resourceInputs["storageRoot"] = state ? state.storageRoot : undefined;
}
else {
const args = argsOrState;
if ((!args || args.catalogName === undefined) && !opts.urn) {
throw new Error("Missing required property 'catalogName'");
}
resourceInputs["catalogName"] = args ? args.catalogName : undefined;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["enablePredictiveOptimization"] = args ? args.enablePredictiveOptimization : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["metastoreId"] = args ? args.metastoreId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["properties"] = args ? args.properties : undefined;
resourceInputs["storageRoot"] = args ? args.storageRoot : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Schema.__pulumiType, name, resourceInputs, opts);
}
}
exports.Schema = Schema;
/** @internal */
Schema.__pulumiType = 'databricks:index/schema:Schema';
//# sourceMappingURL=schema.js.map
;