UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

149 lines 6.84 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.Recipient = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * > This resource can only be used with a workspace-level provider! * * In Delta Sharing, a recipient is an entity that receives shares from a provider. In Unity Catalog, a share is a securable object that represents an organization and associates it with a credential or secure sharing identifier that allows that organization to access one or more shares. * * As a data provider (sharer), you can define multiple recipients for any given Unity Catalog metastore, but if you want to share data from multiple metastores with a particular user or group of users, you must define the recipient separately for each metastore. A recipient can have access to multiple shares. * * A `databricks.Recipient` is contained within databricks.Metastore and can have permissions to `SELECT` from a list of shares. * * ## Example Usage * * ### Databricks Sharing with non databricks recipient * * Setting `authenticationType` type to `TOKEN` creates a temporary url to download a credentials file. This is used to * authenticate to the sharing server to access data. This is for when the recipient is not using Databricks. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * import * as random from "@pulumi/random"; * * const db2opensharecode = new random.index.Password("db2opensharecode", { * length: 16, * special: true, * }); * const current = databricks.getCurrentUser({}); * const db2open = new databricks.Recipient("db2open", { * name: current.then(current => `${current.alphanumeric}-recipient`), * comment: "Made by Pulumi", * authenticationType: "TOKEN", * sharingCode: db2opensharecode.result, * ipAccessList: { * allowedIpAddresses: [], * }, * }); * ``` * * ## Import * * The recipient resource can be imported using the name of the recipient: * * hcl * * import { * * to = databricks_recipient.this * * id = "<recipient_name>" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * bash * * ```sh * $ pulumi import databricks:index/recipient:Recipient this "<recipient_name>" * ``` */ class Recipient extends pulumi.CustomResource { /** * Get an existing Recipient 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 Recipient(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Recipient. 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'] === Recipient.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["activated"] = state?.activated; resourceInputs["activationUrl"] = state?.activationUrl; resourceInputs["authenticationType"] = state?.authenticationType; resourceInputs["cloud"] = state?.cloud; resourceInputs["comment"] = state?.comment; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["createdBy"] = state?.createdBy; resourceInputs["dataRecipientGlobalMetastoreId"] = state?.dataRecipientGlobalMetastoreId; resourceInputs["expirationTime"] = state?.expirationTime; resourceInputs["ipAccessList"] = state?.ipAccessList; resourceInputs["metastoreId"] = state?.metastoreId; resourceInputs["name"] = state?.name; resourceInputs["owner"] = state?.owner; resourceInputs["propertiesKvpairs"] = state?.propertiesKvpairs; resourceInputs["region"] = state?.region; resourceInputs["sharingCode"] = state?.sharingCode; resourceInputs["tokens"] = state?.tokens; resourceInputs["updatedAt"] = state?.updatedAt; resourceInputs["updatedBy"] = state?.updatedBy; } else { const args = argsOrState; if (args?.authenticationType === undefined && !opts.urn) { throw new Error("Missing required property 'authenticationType'"); } resourceInputs["authenticationType"] = args?.authenticationType; resourceInputs["comment"] = args?.comment; resourceInputs["dataRecipientGlobalMetastoreId"] = args?.dataRecipientGlobalMetastoreId; resourceInputs["expirationTime"] = args?.expirationTime; resourceInputs["ipAccessList"] = args?.ipAccessList; resourceInputs["name"] = args?.name; resourceInputs["owner"] = args?.owner; resourceInputs["propertiesKvpairs"] = args?.propertiesKvpairs; resourceInputs["sharingCode"] = args?.sharingCode ? pulumi.secret(args.sharingCode) : undefined; resourceInputs["tokens"] = args?.tokens; resourceInputs["activated"] = undefined /*out*/; resourceInputs["activationUrl"] = undefined /*out*/; resourceInputs["cloud"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["createdBy"] = undefined /*out*/; resourceInputs["metastoreId"] = undefined /*out*/; resourceInputs["region"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["updatedBy"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["sharingCode"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Recipient.__pulumiType, name, resourceInputs, opts); } } exports.Recipient = Recipient; /** @internal */ Recipient.__pulumiType = 'databricks:index/recipient:Recipient'; //# sourceMappingURL=recipient.js.map