UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

105 lines 4.07 kB
"use strict"; // *** 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.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: * * hcl * * import { * * to = databricks_metastore_assignment.this * * id = "<workspace_id>|<metastore_id>" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * 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, { ...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?.defaultCatalogName; resourceInputs["metastoreId"] = state?.metastoreId; resourceInputs["workspaceId"] = state?.workspaceId; } else { const args = argsOrState; if (args?.metastoreId === undefined && !opts.urn) { throw new Error("Missing required property 'metastoreId'"); } if (args?.workspaceId === undefined && !opts.urn) { throw new Error("Missing required property 'workspaceId'"); } resourceInputs["defaultCatalogName"] = args?.defaultCatalogName; resourceInputs["metastoreId"] = args?.metastoreId; resourceInputs["workspaceId"] = args?.workspaceId; } 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