@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
123 lines • 5.21 kB
JavaScript
;
// *** 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.CleanRoomAsset = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Clean room assets are data and code objects -- tables, volumes, and notebooks that are shared with the clean room.
*
* ## Example Usage
*
* # Example: Clean Room Asset Resource
*
* ### Example for sharing a table
* This is an example for sharing an asset (table) in a clean room:
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.index.CleanRoomsAsset("this", {
* cleanRoomName: "existing_clean_room",
* name: "creator.default.myasset",
* assetType: "TABLE",
* tableLocalDetails: {
* localName: "some_creator.default.myasset",
* },
* });
* ```
*
* ## Import
*
* As of Pulumi v1.5, resources can be imported through configuration.
*
* hcl
*
* import {
*
* id = "clean_room_name,name,asset_type"
*
* to = databricks_clean_room_asset.this
*
* }
*
* If you are using an older version of Pulumi, import the resource using the `pulumi import` command as follows:
*
* ```sh
* $ pulumi import databricks:index/cleanRoomAsset:CleanRoomAsset databricks_clean_room_asset "clean_room_name,name,asset_type"
* ```
*/
class CleanRoomAsset extends pulumi.CustomResource {
/**
* Get an existing CleanRoomAsset 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 CleanRoomAsset(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CleanRoomAsset. 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'] === CleanRoomAsset.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addedAt"] = state?.addedAt;
resourceInputs["assetType"] = state?.assetType;
resourceInputs["cleanRoomName"] = state?.cleanRoomName;
resourceInputs["foreignTable"] = state?.foreignTable;
resourceInputs["foreignTableLocalDetails"] = state?.foreignTableLocalDetails;
resourceInputs["name"] = state?.name;
resourceInputs["notebook"] = state?.notebook;
resourceInputs["ownerCollaboratorAlias"] = state?.ownerCollaboratorAlias;
resourceInputs["status"] = state?.status;
resourceInputs["table"] = state?.table;
resourceInputs["tableLocalDetails"] = state?.tableLocalDetails;
resourceInputs["view"] = state?.view;
resourceInputs["viewLocalDetails"] = state?.viewLocalDetails;
resourceInputs["volumeLocalDetails"] = state?.volumeLocalDetails;
resourceInputs["workspaceId"] = state?.workspaceId;
}
else {
const args = argsOrState;
if (args?.assetType === undefined && !opts.urn) {
throw new Error("Missing required property 'assetType'");
}
resourceInputs["assetType"] = args?.assetType;
resourceInputs["cleanRoomName"] = args?.cleanRoomName;
resourceInputs["foreignTable"] = args?.foreignTable;
resourceInputs["foreignTableLocalDetails"] = args?.foreignTableLocalDetails;
resourceInputs["name"] = args?.name;
resourceInputs["notebook"] = args?.notebook;
resourceInputs["table"] = args?.table;
resourceInputs["tableLocalDetails"] = args?.tableLocalDetails;
resourceInputs["view"] = args?.view;
resourceInputs["viewLocalDetails"] = args?.viewLocalDetails;
resourceInputs["volumeLocalDetails"] = args?.volumeLocalDetails;
resourceInputs["workspaceId"] = args?.workspaceId;
resourceInputs["addedAt"] = undefined /*out*/;
resourceInputs["ownerCollaboratorAlias"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CleanRoomAsset.__pulumiType, name, resourceInputs, opts);
}
}
exports.CleanRoomAsset = CleanRoomAsset;
/** @internal */
CleanRoomAsset.__pulumiType = 'databricks:index/cleanRoomAsset:CleanRoomAsset';
//# sourceMappingURL=cleanRoomAsset.js.map