1. Packages
  2. Databricks
  3. API Docs
  4. GitCredential
Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi

databricks.GitCredential

Explore with Pulumi AI

databricks logo
Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi

    This resource allows you to manage credentials for Databricks Repos using Git Credentials API.

    Example Usage

    You can declare Pulumi-managed Git credential using following code:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const ado = new databricks.GitCredential("ado", {
        gitUsername: "myuser",
        gitProvider: "azureDevOpsServices",
        personalAccessToken: "sometoken",
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    ado = databricks.GitCredential("ado",
        git_username="myuser",
        git_provider="azureDevOpsServices",
        personal_access_token="sometoken")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := databricks.NewGitCredential(ctx, "ado", &databricks.GitCredentialArgs{
    			GitUsername:         pulumi.String("myuser"),
    			GitProvider:         pulumi.String("azureDevOpsServices"),
    			PersonalAccessToken: pulumi.String("sometoken"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var ado = new Databricks.GitCredential("ado", new()
        {
            GitUsername = "myuser",
            GitProvider = "azureDevOpsServices",
            PersonalAccessToken = "sometoken",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.GitCredential;
    import com.pulumi.databricks.GitCredentialArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ado = new GitCredential("ado", GitCredentialArgs.builder()
                .gitUsername("myuser")
                .gitProvider("azureDevOpsServices")
                .personalAccessToken("sometoken")
                .build());
    
        }
    }
    
    resources:
      ado:
        type: databricks:GitCredential
        properties:
          gitUsername: myuser
          gitProvider: azureDevOpsServices
          personalAccessToken: sometoken
    

    The following resources are often used in the same context:

    • databricks.Repo to manage Databricks Repos.

    Create GitCredential Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GitCredential(name: string, args: GitCredentialArgs, opts?: CustomResourceOptions);
    @overload
    def GitCredential(resource_name: str,
                      args: GitCredentialArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def GitCredential(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      git_provider: Optional[str] = None,
                      force: Optional[bool] = None,
                      git_username: Optional[str] = None,
                      personal_access_token: Optional[str] = None)
    func NewGitCredential(ctx *Context, name string, args GitCredentialArgs, opts ...ResourceOption) (*GitCredential, error)
    public GitCredential(string name, GitCredentialArgs args, CustomResourceOptions? opts = null)
    public GitCredential(String name, GitCredentialArgs args)
    public GitCredential(String name, GitCredentialArgs args, CustomResourceOptions options)
    
    type: databricks:GitCredential
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GitCredentialArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GitCredentialArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GitCredentialArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GitCredentialArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GitCredentialArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var gitCredentialResource = new Databricks.GitCredential("gitCredentialResource", new()
    {
        GitProvider = "string",
        Force = false,
        GitUsername = "string",
        PersonalAccessToken = "string",
    });
    
    example, err := databricks.NewGitCredential(ctx, "gitCredentialResource", &databricks.GitCredentialArgs{
    	GitProvider:         pulumi.String("string"),
    	Force:               pulumi.Bool(false),
    	GitUsername:         pulumi.String("string"),
    	PersonalAccessToken: pulumi.String("string"),
    })
    
    var gitCredentialResource = new GitCredential("gitCredentialResource", GitCredentialArgs.builder()
        .gitProvider("string")
        .force(false)
        .gitUsername("string")
        .personalAccessToken("string")
        .build());
    
    git_credential_resource = databricks.GitCredential("gitCredentialResource",
        git_provider="string",
        force=False,
        git_username="string",
        personal_access_token="string")
    
    const gitCredentialResource = new databricks.GitCredential("gitCredentialResource", {
        gitProvider: "string",
        force: false,
        gitUsername: "string",
        personalAccessToken: "string",
    });
    
    type: databricks:GitCredential
    properties:
        force: false
        gitProvider: string
        gitUsername: string
        personalAccessToken: string
    

    GitCredential Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GitCredential resource accepts the following input properties:

    GitProvider string
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    Force bool
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    GitUsername string
    user name at Git provider.
    PersonalAccessToken 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.
    GitProvider string
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    Force bool
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    GitUsername string
    user name at Git provider.
    PersonalAccessToken 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.
    gitProvider String
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    force Boolean
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    gitUsername String
    user name at Git provider.
    personalAccessToken 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.
    gitProvider string
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    force boolean
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    gitUsername string
    user name at Git provider.
    personalAccessToken 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.
    git_provider str
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    force bool
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    git_username str
    user name at Git provider.
    personal_access_token str
    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.
    gitProvider String
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    force Boolean
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    gitUsername String
    user name at Git provider.
    personalAccessToken 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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GitCredential resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GitCredential Resource

    Get an existing GitCredential resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GitCredentialState, opts?: CustomResourceOptions): GitCredential
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            force: Optional[bool] = None,
            git_provider: Optional[str] = None,
            git_username: Optional[str] = None,
            personal_access_token: Optional[str] = None) -> GitCredential
    func GetGitCredential(ctx *Context, name string, id IDInput, state *GitCredentialState, opts ...ResourceOption) (*GitCredential, error)
    public static GitCredential Get(string name, Input<string> id, GitCredentialState? state, CustomResourceOptions? opts = null)
    public static GitCredential get(String name, Output<String> id, GitCredentialState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Force bool
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    GitProvider string
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    GitUsername string
    user name at Git provider.
    PersonalAccessToken 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.
    Force bool
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    GitProvider string
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    GitUsername string
    user name at Git provider.
    PersonalAccessToken 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.
    force Boolean
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    gitProvider String
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    gitUsername String
    user name at Git provider.
    personalAccessToken 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.
    force boolean
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    gitProvider string
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    gitUsername string
    user name at Git provider.
    personalAccessToken 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.
    force bool
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    git_provider str
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    git_username str
    user name at Git provider.
    personal_access_token str
    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.
    force Boolean
    specify if settings need to be enforced - right now, Databricks allows only single Git credential, so if it's already configured, the apply operation will fail.
    gitProvider String
    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): gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.
    gitUsername String
    user name at Git provider.
    personalAccessToken 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.

    Import

    The resource cluster can be imported using ID of Git credential that could be obtained via REST API:

    bash

    $ pulumi import databricks:index/gitCredential:GitCredential this <git-credential-id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi