UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

93 lines 4.01 kB
"use strict"; // *** 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.MetastoreAssignment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * > This resource can be used with an account or workspace-level provider. * * A single databricks.Metastore can be shared across Databricks workspaces, and each linked workspace has a consistent view of the data and a single set of access policies. You can only create a single metastore for each region in which your organization operates. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.Metastore("this", { * name: "primary", * storageRoot: `s3://${metastore.id}/metastore`, * owner: "uc admins", * region: "us-east-1", * forceDestroy: true, * }); * const thisMetastoreAssignment = new databricks.MetastoreAssignment("this", { * metastoreId: _this.id, * workspaceId: workspaceId, * }); * ``` * * ## Import * * This resource can be imported by combination of workspace id and metastore id: * * bash * * ```sh * $ pulumi import databricks:index/metastoreAssignment:MetastoreAssignment this '<workspace_id>|<metastore_id>' * ``` */ class MetastoreAssignment extends pulumi.CustomResource { /** * Get an existing MetastoreAssignment 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 MetastoreAssignment(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MetastoreAssignment. 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'] === MetastoreAssignment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["defaultCatalogName"] = state ? state.defaultCatalogName : undefined; resourceInputs["metastoreId"] = state ? state.metastoreId : undefined; resourceInputs["workspaceId"] = state ? state.workspaceId : undefined; } else { const args = argsOrState; if ((!args || args.metastoreId === undefined) && !opts.urn) { throw new Error("Missing required property 'metastoreId'"); } if ((!args || args.workspaceId === undefined) && !opts.urn) { throw new Error("Missing required property 'workspaceId'"); } resourceInputs["defaultCatalogName"] = args ? args.defaultCatalogName : undefined; resourceInputs["metastoreId"] = args ? args.metastoreId : undefined; resourceInputs["workspaceId"] = args ? args.workspaceId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MetastoreAssignment.__pulumiType, name, resourceInputs, opts); } } exports.MetastoreAssignment = MetastoreAssignment; /** @internal */ MetastoreAssignment.__pulumiType = 'databricks:index/metastoreAssignment:MetastoreAssignment'; //# sourceMappingURL=metastoreAssignment.js.map