UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

123 lines 5.46 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.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). * * > This resource can only be used with a workspace-level provider! * * > 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 [Lakeflow Declarative Pipelines](https://docs.databricks.com/aws/en/dlt). * * 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) * * hcl * * import { * * to = databricks_repo.this * * id = "repo_id" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * 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, { ...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?.branch; resourceInputs["commitHash"] = state?.commitHash; resourceInputs["gitProvider"] = state?.gitProvider; resourceInputs["path"] = state?.path; resourceInputs["sparseCheckout"] = state?.sparseCheckout; resourceInputs["tag"] = state?.tag; resourceInputs["url"] = state?.url; resourceInputs["workspacePath"] = state?.workspacePath; } else { const args = argsOrState; if (args?.url === undefined && !opts.urn) { throw new Error("Missing required property 'url'"); } resourceInputs["branch"] = args?.branch; resourceInputs["commitHash"] = args?.commitHash; resourceInputs["gitProvider"] = args?.gitProvider; resourceInputs["path"] = args?.path; resourceInputs["sparseCheckout"] = args?.sparseCheckout; resourceInputs["tag"] = args?.tag; resourceInputs["url"] = args?.url; 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