@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
170 lines (169 loc) • 7.71 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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).
*
* > This resource can only be used with a workspace-level provider!
*
* ## Example Usage
*
* ### Git credential that uses personal access token
*
* 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",
* });
* ```
*
* ### Git credential configuration for Azure Service Principal and Azure DevOps
*
* Databricks now supports Azure service principal federation to Azure DevOps. Follow the [documentation](https://learn.microsoft.com/en-us/azure/databricks/repos/automate-with-ms-entra) on how to configure service principal federation, and after everything is configured, it could be used as simple as:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ado = new databricks.GitCredential("ado", {gitProvider: "azureDevOpsServicesAad"});
* ```
*
* ## 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:
*
* hcl
*
* import {
*
* to = databricks_git_credential.this
*
* id = "<git-credential-id>"
*
* }
*
* Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/gitCredential:GitCredential this <git-credential-id>
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: GitCredentialState, opts?: pulumi.CustomResourceOptions): GitCredential;
/**
* 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: any): obj is GitCredential;
/**
* specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
*/
readonly force: pulumi.Output<boolean | undefined>;
/**
* case insensitive name of the Git provider. Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
*/
readonly gitProvider: pulumi.Output<string>;
/**
* user name at Git provider.
*/
readonly gitUsername: pulumi.Output<string | undefined>;
/**
* boolean flag specifying if the credential is the default for the given provider type.
*/
readonly isDefaultForProvider: pulumi.Output<boolean | undefined>;
/**
* the name of the git credential, used for identification and ease of lookup.
*/
readonly name: pulumi.Output<string>;
/**
* The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
*/
readonly personalAccessToken: pulumi.Output<string | undefined>;
/**
* Create a GitCredential resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: GitCredentialArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering GitCredential resources.
*/
export interface GitCredentialState {
/**
* specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
*/
force?: pulumi.Input<boolean>;
/**
* case insensitive name of the Git provider. Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
*/
gitProvider?: pulumi.Input<string>;
/**
* user name at Git provider.
*/
gitUsername?: pulumi.Input<string>;
/**
* boolean flag specifying if the credential is the default for the given provider type.
*/
isDefaultForProvider?: pulumi.Input<boolean>;
/**
* the name of the git credential, used for identification and ease of lookup.
*/
name?: pulumi.Input<string>;
/**
* The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
*/
personalAccessToken?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a GitCredential resource.
*/
export interface GitCredentialArgs {
/**
* specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
*/
force?: pulumi.Input<boolean>;
/**
* case insensitive name of the Git provider. Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
*/
gitProvider: pulumi.Input<string>;
/**
* user name at Git provider.
*/
gitUsername?: pulumi.Input<string>;
/**
* boolean flag specifying if the credential is the default for the given provider type.
*/
isDefaultForProvider?: pulumi.Input<boolean>;
/**
* the name of the git credential, used for identification and ease of lookup.
*/
name?: pulumi.Input<string>;
/**
* The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
*/
personalAccessToken?: pulumi.Input<string>;
}