@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
109 lines • 5.55 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.Repo = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to manage [Databricks Git folders](https://docs.databricks.com/en/repos/index.html) (formerly known as Databricks Repos).
*
* > To create a Git folder from a private repository you need to configure Git token as described in the [documentation](https://docs.databricks.com/en/repos/index.html#configure-your-git-integration-with-databricks). To set this token you can use databricks.GitCredential resource.
*
* ## Example Usage
*
* You can declare Pulumi-managed Git folder by specifying `url` attribute of Git repository. In addition to that you may need to specify `gitProvider` attribute if Git provider doesn't belong to cloud Git providers (Github, GitLab, ...). If `path` attribute isn't provided, then Git folder will be created in the default location:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const nutterInHome = new databricks.Repo("nutter_in_home", {url: "https://github.com/user/demo.git"});
* ```
*
* ## Access Control
*
* * databricks.Permissions can control which groups or individual users can access repos.
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.GitCredential to manage Git credentials.
* * databricks.Directory to manage directories in [Databricks Workpace](https://docs.databricks.com/workspace/workspace-objects.html).
* * databricks.Pipeline to deploy [Delta Live Tables](https://docs.databricks.com/data-engineering/delta-live-tables/index.html).
* * databricks.Secret to manage [secrets](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace.
* * databricks.SecretAcl to manage access to [secrets](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace.
* * databricks.SecretScope to create [secret scopes](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace.
* * databricks.WorkspaceConf to manage workspace configuration for expert usage.
*
* ## Import
*
* The resource can be imported using the Git folder ID (obtained via UI or using API)
*
* bash
*
* ```sh
* $ pulumi import databricks:index/repo:Repo this repo_id
* ```
*/
class Repo extends pulumi.CustomResource {
/**
* Get an existing Repo 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 Repo(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Repo. 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'] === Repo.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["branch"] = state ? state.branch : undefined;
resourceInputs["commitHash"] = state ? state.commitHash : undefined;
resourceInputs["gitProvider"] = state ? state.gitProvider : undefined;
resourceInputs["path"] = state ? state.path : undefined;
resourceInputs["sparseCheckout"] = state ? state.sparseCheckout : undefined;
resourceInputs["tag"] = state ? state.tag : undefined;
resourceInputs["url"] = state ? state.url : undefined;
resourceInputs["workspacePath"] = state ? state.workspacePath : undefined;
}
else {
const args = argsOrState;
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["branch"] = args ? args.branch : undefined;
resourceInputs["commitHash"] = args ? args.commitHash : undefined;
resourceInputs["gitProvider"] = args ? args.gitProvider : undefined;
resourceInputs["path"] = args ? args.path : undefined;
resourceInputs["sparseCheckout"] = args ? args.sparseCheckout : undefined;
resourceInputs["tag"] = args ? args.tag : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["workspacePath"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Repo.__pulumiType, name, resourceInputs, opts);
}
}
exports.Repo = Repo;
/** @internal */
Repo.__pulumiType = 'databricks:index/repo:Repo';
//# sourceMappingURL=repo.js.map
;