@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
92 lines • 3.8 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.GitCredential = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to manage credentials for [Databricks Repos](https://docs.databricks.com/repos.html) using [Git Credentials API](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html).
*
* ## Example Usage
*
* You can declare Pulumi-managed Git credential using following code:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ado = new databricks.GitCredential("ado", {
* gitUsername: "myuser",
* gitProvider: "azureDevOpsServices",
* personalAccessToken: "sometoken",
* });
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * databricks.Repo to manage Databricks Repos.
*
* ## Import
*
* The resource cluster can be imported using ID of Git credential that could be obtained via REST API:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/gitCredential:GitCredential this <git-credential-id>
* ```
*/
class GitCredential extends pulumi.CustomResource {
/**
* Get an existing GitCredential 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 GitCredential(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GitCredential. 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'] === GitCredential.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["force"] = state ? state.force : undefined;
resourceInputs["gitProvider"] = state ? state.gitProvider : undefined;
resourceInputs["gitUsername"] = state ? state.gitUsername : undefined;
resourceInputs["personalAccessToken"] = state ? state.personalAccessToken : undefined;
}
else {
const args = argsOrState;
if ((!args || args.gitProvider === undefined) && !opts.urn) {
throw new Error("Missing required property 'gitProvider'");
}
resourceInputs["force"] = args ? args.force : undefined;
resourceInputs["gitProvider"] = args ? args.gitProvider : undefined;
resourceInputs["gitUsername"] = args ? args.gitUsername : undefined;
resourceInputs["personalAccessToken"] = args ? args.personalAccessToken : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GitCredential.__pulumiType, name, resourceInputs, opts);
}
}
exports.GitCredential = GitCredential;
/** @internal */
GitCredential.__pulumiType = 'databricks:index/gitCredential:GitCredential';
//# sourceMappingURL=gitCredential.js.map
;