1. Packages
  2. Packages
  3. Databricks Provider
  4. API Docs
  5. Secret
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

    With this resource you can insert a secret under the provided scope with the given name. If a secret already exists with the same name, this command overwrites the existing secret’s value. The server encrypts the secret using the secret scope’s encryption settings before storing it. You must have WRITE or MANAGE permission on the secret scope. The secret key must consist of alphanumeric characters, dashes, underscores, and periods, and cannot exceed 128 characters. The maximum allowed secret value size is 128 KB. The maximum number of secrets in a given scope is 1000. You can read a secret value only from within a command on a cluster (for example, through a notebook); there is no API to read a secret value outside of a cluster. The permission applied is based on who is invoking the command and you must have at least READ permission. Please consult Secrets User Guide for more details.

    The following resources are often used in the same context:

    Example Usage

    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var app = new Databricks.SecretScope("app", new Databricks.SecretScopeArgs
            {
            });
            var publishingApi = new Databricks.Secret("publishingApi", new Databricks.SecretArgs
            {
                Key = "publishing_api",
                StringValue = data.Azurerm_key_vault_secret.Example.Value,
                Scope = app.Id,
            });
        }
    
    }
    
    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 {
    		app, err := databricks.NewSecretScope(ctx, "app", nil)
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewSecret(ctx, "publishingApi", &databricks.SecretArgs{
    			Key:         pulumi.String("publishing_api"),
    			StringValue: pulumi.Any(data.Azurerm_key_vault_secret.Example.Value),
    			Scope:       app.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const app = new databricks.SecretScope("app", {});
    const publishingApi = new databricks.Secret("publishingApi", {
        key: "publishing_api",
        stringValue: data.azurerm_key_vault_secret.example.value,
        scope: app.id,
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    app = databricks.SecretScope("app")
    publishing_api = databricks.Secret("publishingApi",
        key="publishing_api",
        string_value=data["azurerm_key_vault_secret"]["example"]["value"],
        scope=app.id)
    

    Example coming soon!

    Create Secret Resource

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

    Constructor syntax

    new Secret(name: string, args: SecretArgs, opts?: CustomResourceOptions);
    @overload
    def Secret(resource_name: str,
               args: SecretArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Secret(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               key: Optional[str] = None,
               scope: Optional[str] = None,
               string_value: Optional[str] = None)
    func NewSecret(ctx *Context, name string, args SecretArgs, opts ...ResourceOption) (*Secret, error)
    public Secret(string name, SecretArgs args, CustomResourceOptions? opts = null)
    public Secret(String name, SecretArgs args)
    public Secret(String name, SecretArgs args, CustomResourceOptions options)
    
    type: databricks:Secret
    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 SecretArgs
    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 SecretArgs
    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 SecretArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretArgs
    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 secretResource = new Databricks.Secret("secretResource", new()
    {
        Key = "string",
        Scope = "string",
        StringValue = "string",
    });
    
    example, err := databricks.NewSecret(ctx, "secretResource", &databricks.SecretArgs{
    	Key:         pulumi.String("string"),
    	Scope:       pulumi.String("string"),
    	StringValue: pulumi.String("string"),
    })
    
    var secretResource = new Secret("secretResource", SecretArgs.builder()
        .key("string")
        .scope("string")
        .stringValue("string")
        .build());
    
    secret_resource = databricks.Secret("secretResource",
        key="string",
        scope="string",
        string_value="string")
    
    const secretResource = new databricks.Secret("secretResource", {
        key: "string",
        scope: "string",
        stringValue: "string",
    });
    
    type: databricks:Secret
    properties:
        key: string
        scope: string
        stringValue: string
    

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

    Key string
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    Scope string
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    StringValue string
    (String) super secret sensitive value.
    Key string
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    Scope string
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    StringValue string
    (String) super secret sensitive value.
    key String
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    scope String
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    stringValue String
    (String) super secret sensitive value.
    key string
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    scope string
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    stringValue string
    (String) super secret sensitive value.
    key str
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    scope str
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    string_value str
    (String) super secret sensitive value.
    key String
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    scope String
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    stringValue String
    (String) super secret sensitive value.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedTimestamp int
    (Integer) time secret was updated
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedTimestamp int
    (Integer) time secret was updated
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedTimestamp Integer
    (Integer) time secret was updated
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdatedTimestamp number
    (Integer) time secret was updated
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated_timestamp int
    (Integer) time secret was updated
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedTimestamp Number
    (Integer) time secret was updated

    Look up Existing Secret Resource

    Get an existing Secret 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?: SecretState, opts?: CustomResourceOptions): Secret
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            last_updated_timestamp: Optional[int] = None,
            scope: Optional[str] = None,
            string_value: Optional[str] = None) -> Secret
    func GetSecret(ctx *Context, name string, id IDInput, state *SecretState, opts ...ResourceOption) (*Secret, error)
    public static Secret Get(string name, Input<string> id, SecretState? state, CustomResourceOptions? opts = null)
    public static Secret get(String name, Output<String> id, SecretState state, CustomResourceOptions options)
    resources:  _:    type: databricks:Secret    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:
    Key string
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    LastUpdatedTimestamp int
    (Integer) time secret was updated
    Scope string
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    StringValue string
    (String) super secret sensitive value.
    Key string
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    LastUpdatedTimestamp int
    (Integer) time secret was updated
    Scope string
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    StringValue string
    (String) super secret sensitive value.
    key String
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    lastUpdatedTimestamp Integer
    (Integer) time secret was updated
    scope String
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    stringValue String
    (String) super secret sensitive value.
    key string
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    lastUpdatedTimestamp number
    (Integer) time secret was updated
    scope string
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    stringValue string
    (String) super secret sensitive value.
    key str
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    last_updated_timestamp int
    (Integer) time secret was updated
    scope str
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    string_value str
    (String) super secret sensitive value.
    key String
    (String) key within secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    lastUpdatedTimestamp Number
    (Integer) time secret was updated
    scope String
    (String) name of databricks secret scope. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
    stringValue String
    (String) super secret sensitive value.

    Import

    The resource secret can be imported using scopeName|||secretKey combination. This may change in future versions. bash

     $ pulumi import databricks:index/secret:Secret app `scopeName|||secretKey`
    

    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.