@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
137 lines • 7.25 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.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.
*
* 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, Object.assign(Object.assign({}, 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 ? state.activated : undefined;
resourceInputs["activationUrl"] = state ? state.activationUrl : undefined;
resourceInputs["authenticationType"] = state ? state.authenticationType : undefined;
resourceInputs["cloud"] = state ? state.cloud : undefined;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["createdBy"] = state ? state.createdBy : undefined;
resourceInputs["dataRecipientGlobalMetastoreId"] = state ? state.dataRecipientGlobalMetastoreId : undefined;
resourceInputs["expirationTime"] = state ? state.expirationTime : undefined;
resourceInputs["ipAccessList"] = state ? state.ipAccessList : undefined;
resourceInputs["metastoreId"] = state ? state.metastoreId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["propertiesKvpairs"] = state ? state.propertiesKvpairs : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sharingCode"] = state ? state.sharingCode : undefined;
resourceInputs["tokens"] = state ? state.tokens : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["updatedBy"] = state ? state.updatedBy : undefined;
}
else {
const args = argsOrState;
if ((!args || args.authenticationType === undefined) && !opts.urn) {
throw new Error("Missing required property 'authenticationType'");
}
resourceInputs["authenticationType"] = args ? args.authenticationType : undefined;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["dataRecipientGlobalMetastoreId"] = args ? args.dataRecipientGlobalMetastoreId : undefined;
resourceInputs["expirationTime"] = args ? args.expirationTime : undefined;
resourceInputs["ipAccessList"] = args ? args.ipAccessList : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["propertiesKvpairs"] = args ? args.propertiesKvpairs : undefined;
resourceInputs["sharingCode"] = (args === null || args === void 0 ? void 0 : args.sharingCode) ? pulumi.secret(args.sharingCode) : undefined;
resourceInputs["tokens"] = args ? args.tokens : undefined;
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
;