@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
102 lines • 4.51 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.ArtifactAllowlist = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > It is required to define all allowlist for an artifact type in a single resource, otherwise Pulumi cannot guarantee config drift prevention.
*
* > This resource can only be used with a workspace-level provider!
*
* In Databricks Runtime 13.3 and above, you can add libraries and init scripts to the allowlist in UC so that users can leverage these artifacts on compute configured with shared access mode.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const initScripts = new databricks.ArtifactAllowlist("init_scripts", {
* artifactType: "INIT_SCRIPT",
* artifactMatchers: [{
* artifact: "/Volumes/inits",
* matchType: "PREFIX_MATCH",
* }],
* });
* ```
*
* ## Related Resources
*
* The following resources are used in the same context:
*
* * databricks.Cluster to create [Databricks Clusters](https://docs.databricks.com/clusters/index.html).
* * databricks.Library to install a [library](https://docs.databricks.com/libraries/index.html) on databricks_cluster.
*
* ## Import
*
* This resource can be imported by name:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/artifactAllowlist:ArtifactAllowlist this '<metastore_id>|<artifact_type>'
* ```
*/
class ArtifactAllowlist extends pulumi.CustomResource {
/**
* Get an existing ArtifactAllowlist 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 ArtifactAllowlist(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ArtifactAllowlist. 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'] === ArtifactAllowlist.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["artifactMatchers"] = state ? state.artifactMatchers : undefined;
resourceInputs["artifactType"] = state ? state.artifactType : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["createdBy"] = state ? state.createdBy : undefined;
resourceInputs["metastoreId"] = state ? state.metastoreId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.artifactMatchers === undefined) && !opts.urn) {
throw new Error("Missing required property 'artifactMatchers'");
}
if ((!args || args.artifactType === undefined) && !opts.urn) {
throw new Error("Missing required property 'artifactType'");
}
resourceInputs["artifactMatchers"] = args ? args.artifactMatchers : undefined;
resourceInputs["artifactType"] = args ? args.artifactType : undefined;
resourceInputs["createdAt"] = args ? args.createdAt : undefined;
resourceInputs["createdBy"] = args ? args.createdBy : undefined;
resourceInputs["metastoreId"] = args ? args.metastoreId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ArtifactAllowlist.__pulumiType, name, resourceInputs, opts);
}
}
exports.ArtifactAllowlist = ArtifactAllowlist;
/** @internal */
ArtifactAllowlist.__pulumiType = 'databricks:index/artifactAllowlist:ArtifactAllowlist';
//# sourceMappingURL=artifactAllowlist.js.map
;