1. Packages
  2. Databricks Provider
  3. API Docs
  4. SecretScope
Databricks v1.67.0 published on Thursday, Apr 17, 2025 by Pulumi

databricks.SecretScope

Explore with Pulumi AI

Sometimes accessing data requires that you authenticate to external data sources through JDBC. Instead of directly entering your credentials into a notebook, use Databricks secrets to store your credentials and reference them in notebooks and jobs. Please consult Secrets User Guide for more details.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const _this = new databricks.SecretScope("this", {name: "terraform-demo-scope"});
Copy
import pulumi
import pulumi_databricks as databricks

this = databricks.SecretScope("this", name="terraform-demo-scope")
Copy
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.NewSecretScope(ctx, "this", &databricks.SecretScopeArgs{
			Name: pulumi.String("terraform-demo-scope"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var @this = new Databricks.SecretScope("this", new()
    {
        Name = "terraform-demo-scope",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.SecretScope;
import com.pulumi.databricks.SecretScopeArgs;
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 this_ = new SecretScope("this", SecretScopeArgs.builder()
            .name("terraform-demo-scope")
            .build());

    }
}
Copy
resources:
  this:
    type: databricks:SecretScope
    properties:
      name: terraform-demo-scope
Copy

The following resources are often used in the same context:

  • End to end workspace management guide.
  • databricks.Notebook to manage Databricks Notebooks.
  • databricks.Repo to manage Databricks Repos.
  • databricks.Secret to manage secrets in Databricks workspace.
  • databricks.SecretAcl to manage access to secrets in Databricks workspace.

Create SecretScope Resource

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

Constructor syntax

new SecretScope(name: string, args?: SecretScopeArgs, opts?: CustomResourceOptions);
@overload
def SecretScope(resource_name: str,
                args: Optional[SecretScopeArgs] = None,
                opts: Optional[ResourceOptions] = None)

@overload
def SecretScope(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                backend_type: Optional[str] = None,
                initial_manage_principal: Optional[str] = None,
                keyvault_metadata: Optional[SecretScopeKeyvaultMetadataArgs] = None,
                name: Optional[str] = None)
func NewSecretScope(ctx *Context, name string, args *SecretScopeArgs, opts ...ResourceOption) (*SecretScope, error)
public SecretScope(string name, SecretScopeArgs? args = null, CustomResourceOptions? opts = null)
public SecretScope(String name, SecretScopeArgs args)
public SecretScope(String name, SecretScopeArgs args, CustomResourceOptions options)
type: databricks:SecretScope
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args SecretScopeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args SecretScopeArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args SecretScopeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args SecretScopeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SecretScopeArgs
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 secretScopeResource = new Databricks.SecretScope("secretScopeResource", new()
{
    BackendType = "string",
    InitialManagePrincipal = "string",
    KeyvaultMetadata = new Databricks.Inputs.SecretScopeKeyvaultMetadataArgs
    {
        DnsName = "string",
        ResourceId = "string",
    },
    Name = "string",
});
Copy
example, err := databricks.NewSecretScope(ctx, "secretScopeResource", &databricks.SecretScopeArgs{
	BackendType:            pulumi.String("string"),
	InitialManagePrincipal: pulumi.String("string"),
	KeyvaultMetadata: &databricks.SecretScopeKeyvaultMetadataArgs{
		DnsName:    pulumi.String("string"),
		ResourceId: pulumi.String("string"),
	},
	Name: pulumi.String("string"),
})
Copy
var secretScopeResource = new SecretScope("secretScopeResource", SecretScopeArgs.builder()
    .backendType("string")
    .initialManagePrincipal("string")
    .keyvaultMetadata(SecretScopeKeyvaultMetadataArgs.builder()
        .dnsName("string")
        .resourceId("string")
        .build())
    .name("string")
    .build());
Copy
secret_scope_resource = databricks.SecretScope("secretScopeResource",
    backend_type="string",
    initial_manage_principal="string",
    keyvault_metadata={
        "dns_name": "string",
        "resource_id": "string",
    },
    name="string")
Copy
const secretScopeResource = new databricks.SecretScope("secretScopeResource", {
    backendType: "string",
    initialManagePrincipal: "string",
    keyvaultMetadata: {
        dnsName: "string",
        resourceId: "string",
    },
    name: "string",
});
Copy
type: databricks:SecretScope
properties:
    backendType: string
    initialManagePrincipal: string
    keyvaultMetadata:
        dnsName: string
        resourceId: string
    name: string
Copy

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

BackendType string
Either DATABRICKS or AZURE_KEYVAULT
InitialManagePrincipal Changes to this property will trigger replacement. string
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
KeyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadata
Name Changes to this property will trigger replacement. string
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
BackendType string
Either DATABRICKS or AZURE_KEYVAULT
InitialManagePrincipal Changes to this property will trigger replacement. string
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
KeyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadataArgs
Name Changes to this property will trigger replacement. string
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backendType String
Either DATABRICKS or AZURE_KEYVAULT
initialManagePrincipal Changes to this property will trigger replacement. String
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadata
name Changes to this property will trigger replacement. String
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backendType string
Either DATABRICKS or AZURE_KEYVAULT
initialManagePrincipal Changes to this property will trigger replacement. string
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadata
name Changes to this property will trigger replacement. string
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backend_type str
Either DATABRICKS or AZURE_KEYVAULT
initial_manage_principal Changes to this property will trigger replacement. str
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvault_metadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadataArgs
name Changes to this property will trigger replacement. str
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backendType String
Either DATABRICKS or AZURE_KEYVAULT
initialManagePrincipal Changes to this property will trigger replacement. String
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvaultMetadata Changes to this property will trigger replacement. Property Map
name Changes to this property will trigger replacement. String
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.

Outputs

All input properties are implicitly available as output properties. Additionally, the SecretScope 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 SecretScope Resource

Get an existing SecretScope 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?: SecretScopeState, opts?: CustomResourceOptions): SecretScope
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backend_type: Optional[str] = None,
        initial_manage_principal: Optional[str] = None,
        keyvault_metadata: Optional[SecretScopeKeyvaultMetadataArgs] = None,
        name: Optional[str] = None) -> SecretScope
func GetSecretScope(ctx *Context, name string, id IDInput, state *SecretScopeState, opts ...ResourceOption) (*SecretScope, error)
public static SecretScope Get(string name, Input<string> id, SecretScopeState? state, CustomResourceOptions? opts = null)
public static SecretScope get(String name, Output<String> id, SecretScopeState state, CustomResourceOptions options)
resources:  _:    type: databricks:SecretScope    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
BackendType string
Either DATABRICKS or AZURE_KEYVAULT
InitialManagePrincipal Changes to this property will trigger replacement. string
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
KeyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadata
Name Changes to this property will trigger replacement. string
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
BackendType string
Either DATABRICKS or AZURE_KEYVAULT
InitialManagePrincipal Changes to this property will trigger replacement. string
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
KeyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadataArgs
Name Changes to this property will trigger replacement. string
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backendType String
Either DATABRICKS or AZURE_KEYVAULT
initialManagePrincipal Changes to this property will trigger replacement. String
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadata
name Changes to this property will trigger replacement. String
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backendType string
Either DATABRICKS or AZURE_KEYVAULT
initialManagePrincipal Changes to this property will trigger replacement. string
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvaultMetadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadata
name Changes to this property will trigger replacement. string
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backend_type str
Either DATABRICKS or AZURE_KEYVAULT
initial_manage_principal Changes to this property will trigger replacement. str
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvault_metadata Changes to this property will trigger replacement. SecretScopeKeyvaultMetadataArgs
name Changes to this property will trigger replacement. str
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
backendType String
Either DATABRICKS or AZURE_KEYVAULT
initialManagePrincipal Changes to this property will trigger replacement. String
The principal with the only possible value users that is initially granted MANAGE permission to the created scope. If it's omitted, then the databricks.SecretAcl with MANAGE permission applied to the scope is assigned to the API request issuer's user identity (see documentation). This part of the state cannot be imported.
keyvaultMetadata Changes to this property will trigger replacement. Property Map
name Changes to this property will trigger replacement. String
Scope name requested by the user. Must be unique within a workspace. Must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.

Supporting Types

SecretScopeKeyvaultMetadata
, SecretScopeKeyvaultMetadataArgs

DnsName
This property is required.
Changes to this property will trigger replacement.
string
ResourceId
This property is required.
Changes to this property will trigger replacement.
string
DnsName
This property is required.
Changes to this property will trigger replacement.
string
ResourceId
This property is required.
Changes to this property will trigger replacement.
string
dnsName
This property is required.
Changes to this property will trigger replacement.
String
resourceId
This property is required.
Changes to this property will trigger replacement.
String
dnsName
This property is required.
Changes to this property will trigger replacement.
string
resourceId
This property is required.
Changes to this property will trigger replacement.
string
dns_name
This property is required.
Changes to this property will trigger replacement.
str
resource_id
This property is required.
Changes to this property will trigger replacement.
str
dnsName
This property is required.
Changes to this property will trigger replacement.
String
resourceId
This property is required.
Changes to this property will trigger replacement.
String

Import

The secret resource scope can be imported using the scope name. initial_manage_principal state won’t be imported, because the underlying API doesn’t include it in the response.

bash

$ pulumi import databricks:index/secretScope:SecretScope object <scopeName>
Copy

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.