1. Packages
  2. Packages
  3. Databricks Provider
  4. API Docs
  5. Token
Viewing docs for Databricks v0.4.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
databricks logo
Viewing docs for Databricks v0.4.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    This resource creates Personal Access Tokens for the same user, that is authenticated with the provider. Most likely you should use databricks.OboToken to create On-Behalf-Of tokens for a databricks.ServicePrincipal in Databricks workspaces on AWS. Databricks workspaces on other clouds use their own native OAuth token flows.

    Example Usage

    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            // initialize provider in normal mode
            var createdWorkspace = new Databricks.Provider("createdWorkspace", new Databricks.ProviderArgs
            {
                Host = databricks_mws_workspaces.This.Workspace_url,
            });
            // create PAT token to provision entities within workspace
            var pat = new Databricks.Token("pat", new Databricks.TokenArgs
            {
                Comment = "Terraform Provisioning",
                LifetimeSeconds = 8640000,
            }, new CustomResourceOptions
            {
                Provider = databricks.Created_workspace,
            });
            this.DatabricksToken = pat.TokenValue;
        }
    
        [Output("databricksToken")]
        public Output<string> DatabricksToken { get; set; }
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks/providers"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := providers.Newdatabricks(ctx, "createdWorkspace", &providers.databricksArgs{
    			Host: databricks_mws_workspaces.This.Workspace_url,
    		})
    		if err != nil {
    			return err
    		}
    		pat, err := databricks.NewToken(ctx, "pat", &databricks.TokenArgs{
    			Comment:         pulumi.String("Terraform Provisioning"),
    			LifetimeSeconds: pulumi.Int(8640000),
    		}, pulumi.Provider(databricks.Created_workspace))
    		if err != nil {
    			return err
    		}
    		ctx.Export("databricksToken", pat.TokenValue)
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    // initialize provider in normal mode
    const createdWorkspace = new databricks.Provider("createdWorkspace", {host: databricks_mws_workspaces["this"].workspace_url});
    // create PAT token to provision entities within workspace
    const pat = new databricks.Token("pat", {
        comment: "Terraform Provisioning",
        lifetimeSeconds: 8640000,
    }, {
        provider: databricks.created_workspace,
    });
    export const databricksToken = pat.tokenValue;
    
    import pulumi
    import pulumi_databricks as databricks
    import pulumi_pulumi as pulumi
    
    # initialize provider in normal mode
    created_workspace = pulumi.providers.Databricks("createdWorkspace", host=databricks_mws_workspaces["this"]["workspace_url"])
    # create PAT token to provision entities within workspace
    pat = databricks.Token("pat",
        comment="Terraform Provisioning",
        lifetime_seconds=8640000,
        opts=pulumi.ResourceOptions(provider=databricks["created_workspace"]))
    pulumi.export("databricksToken", pat.token_value)
    

    Example coming soon!

    Create Token Resource

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

    Constructor syntax

    new Token(name: string, args?: TokenArgs, opts?: CustomResourceOptions);
    @overload
    def Token(resource_name: str,
              args: Optional[TokenArgs] = None,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Token(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              comment: Optional[str] = None,
              creation_time: Optional[int] = None,
              expiry_time: Optional[int] = None,
              lifetime_seconds: Optional[int] = None,
              token_id: Optional[str] = None)
    func NewToken(ctx *Context, name string, args *TokenArgs, opts ...ResourceOption) (*Token, error)
    public Token(string name, TokenArgs? args = null, CustomResourceOptions? opts = null)
    public Token(String name, TokenArgs args)
    public Token(String name, TokenArgs args, CustomResourceOptions options)
    
    type: databricks:Token
    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 TokenArgs
    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 TokenArgs
    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 TokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TokenArgs
    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 tokenResource = new Databricks.Token("tokenResource", new()
    {
        Comment = "string",
        CreationTime = 0,
        ExpiryTime = 0,
        LifetimeSeconds = 0,
        TokenId = "string",
    });
    
    example, err := databricks.NewToken(ctx, "tokenResource", &databricks.TokenArgs{
    	Comment:         pulumi.String("string"),
    	CreationTime:    pulumi.Int(0),
    	ExpiryTime:      pulumi.Int(0),
    	LifetimeSeconds: pulumi.Int(0),
    	TokenId:         pulumi.String("string"),
    })
    
    var tokenResource = new Token("tokenResource", TokenArgs.builder()
        .comment("string")
        .creationTime(0)
        .expiryTime(0)
        .lifetimeSeconds(0)
        .tokenId("string")
        .build());
    
    token_resource = databricks.Token("tokenResource",
        comment="string",
        creation_time=0,
        expiry_time=0,
        lifetime_seconds=0,
        token_id="string")
    
    const tokenResource = new databricks.Token("tokenResource", {
        comment: "string",
        creationTime: 0,
        expiryTime: 0,
        lifetimeSeconds: 0,
        tokenId: "string",
    });
    
    type: databricks:Token
    properties:
        comment: string
        creationTime: 0
        expiryTime: 0
        lifetimeSeconds: 0
        tokenId: string
    

    Token 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 Token resource accepts the following input properties:

    Comment string
    (String) Comment that will appear on the user’s settings page for this token.
    CreationTime int
    ExpiryTime int
    LifetimeSeconds int
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    TokenId string
    Comment string
    (String) Comment that will appear on the user’s settings page for this token.
    CreationTime int
    ExpiryTime int
    LifetimeSeconds int
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    TokenId string
    comment String
    (String) Comment that will appear on the user’s settings page for this token.
    creationTime Integer
    expiryTime Integer
    lifetimeSeconds Integer
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    tokenId String
    comment string
    (String) Comment that will appear on the user’s settings page for this token.
    creationTime number
    expiryTime number
    lifetimeSeconds number
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    tokenId string
    comment str
    (String) Comment that will appear on the user’s settings page for this token.
    creation_time int
    expiry_time int
    lifetime_seconds int
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    token_id str
    comment String
    (String) Comment that will appear on the user’s settings page for this token.
    creationTime Number
    expiryTime Number
    lifetimeSeconds Number
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    tokenId String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    TokenValue string
    Sensitive value of the newly-created token.
    Id string
    The provider-assigned unique ID for this managed resource.
    TokenValue string
    Sensitive value of the newly-created token.
    id String
    The provider-assigned unique ID for this managed resource.
    tokenValue String
    Sensitive value of the newly-created token.
    id string
    The provider-assigned unique ID for this managed resource.
    tokenValue string
    Sensitive value of the newly-created token.
    id str
    The provider-assigned unique ID for this managed resource.
    token_value str
    Sensitive value of the newly-created token.
    id String
    The provider-assigned unique ID for this managed resource.
    tokenValue String
    Sensitive value of the newly-created token.

    Look up Existing Token Resource

    Get an existing Token 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?: TokenState, opts?: CustomResourceOptions): Token
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            creation_time: Optional[int] = None,
            expiry_time: Optional[int] = None,
            lifetime_seconds: Optional[int] = None,
            token_id: Optional[str] = None,
            token_value: Optional[str] = None) -> Token
    func GetToken(ctx *Context, name string, id IDInput, state *TokenState, opts ...ResourceOption) (*Token, error)
    public static Token Get(string name, Input<string> id, TokenState? state, CustomResourceOptions? opts = null)
    public static Token get(String name, Output<String> id, TokenState state, CustomResourceOptions options)
    resources:  _:    type: databricks:Token    get:      id: ${id}
    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:
    Comment string
    (String) Comment that will appear on the user’s settings page for this token.
    CreationTime int
    ExpiryTime int
    LifetimeSeconds int
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    TokenId string
    TokenValue string
    Sensitive value of the newly-created token.
    Comment string
    (String) Comment that will appear on the user’s settings page for this token.
    CreationTime int
    ExpiryTime int
    LifetimeSeconds int
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    TokenId string
    TokenValue string
    Sensitive value of the newly-created token.
    comment String
    (String) Comment that will appear on the user’s settings page for this token.
    creationTime Integer
    expiryTime Integer
    lifetimeSeconds Integer
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    tokenId String
    tokenValue String
    Sensitive value of the newly-created token.
    comment string
    (String) Comment that will appear on the user’s settings page for this token.
    creationTime number
    expiryTime number
    lifetimeSeconds number
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    tokenId string
    tokenValue string
    Sensitive value of the newly-created token.
    comment str
    (String) Comment that will appear on the user’s settings page for this token.
    creation_time int
    expiry_time int
    lifetime_seconds int
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    token_id str
    token_value str
    Sensitive value of the newly-created token.
    comment String
    (String) Comment that will appear on the user’s settings page for this token.
    creationTime Number
    expiryTime Number
    lifetimeSeconds Number
    (Integer) The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely.
    tokenId String
    tokenValue String
    Sensitive value of the newly-created token.

    Import

    -> Note Importing this resource is not currently supported.

    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
    Viewing docs for Databricks v0.4.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.