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"});
import pulumi
import pulumi_databricks as databricks
this = databricks.SecretScope("this", name="terraform-demo-scope")
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
})
}
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",
});
});
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());
}
}
resources:
this:
type: databricks:SecretScope
properties:
name: terraform-demo-scope
Related Resources
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 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 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 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 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 String
- The unique name of the resource.
- args 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",
});
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"),
})
var secretScopeResource = new SecretScope("secretScopeResource", SecretScopeArgs.builder()
.backendType("string")
.initialManagePrincipal("string")
.keyvaultMetadata(SecretScopeKeyvaultMetadataArgs.builder()
.dnsName("string")
.resourceId("string")
.build())
.name("string")
.build());
secret_scope_resource = databricks.SecretScope("secretScopeResource",
backend_type="string",
initial_manage_principal="string",
keyvault_metadata=databricks.SecretScopeKeyvaultMetadataArgs(
dns_name="string",
resource_id="string",
),
name="string")
const secretScopeResource = new databricks.SecretScope("secretScopeResource", {
backendType: "string",
initialManagePrincipal: "string",
keyvaultMetadata: {
dnsName: "string",
resourceId: "string",
},
name: "string",
});
type: databricks:SecretScope
properties:
backendType: string
initialManagePrincipal: string
keyvaultMetadata:
dnsName: string
resourceId: string
name: string
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
The SecretScope resource accepts the following input properties:
- Backend
Type string - Either
DATABRICKS
orAZURE_KEYVAULT
- Initial
Manage stringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata - Name 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 string - Either
DATABRICKS
orAZURE_KEYVAULT
- Initial
Manage stringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata Args - Name 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 String - Either
DATABRICKS
orAZURE_KEYVAULT
- initial
Manage StringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata - name 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 string - Either
DATABRICKS
orAZURE_KEYVAULT
- initial
Manage stringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata - name 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
orAZURE_KEYVAULT
- initial_
manage_ strprincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata Args - name 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.
- backend
Type String - Either
DATABRICKS
orAZURE_KEYVAULT
- initial
Manage StringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 Property Map - name 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)
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.
- Backend
Type string - Either
DATABRICKS
orAZURE_KEYVAULT
- Initial
Manage stringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata - Name 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 string - Either
DATABRICKS
orAZURE_KEYVAULT
- Initial
Manage stringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata Args - Name 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 String - Either
DATABRICKS
orAZURE_KEYVAULT
- initial
Manage StringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata - name 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 string - Either
DATABRICKS
orAZURE_KEYVAULT
- initial
Manage stringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata - name 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
orAZURE_KEYVAULT
- initial_
manage_ strprincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 SecretScope Keyvault Metadata Args - name 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.
- backend
Type String - Either
DATABRICKS
orAZURE_KEYVAULT
- initial
Manage StringPrincipal - The principal with the only possible value
users
that is initially grantedMANAGE
permission to the created scope. If it's omitted, then the databricks.SecretAcl withMANAGE
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 Property Map - name 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
- Dns
Name string - Resource
Id string
- Dns
Name string - Resource
Id string
- dns
Name String - resource
Id String
- dns
Name string - resource
Id string
- dns_
name str - resource_
id str
- dns
Name String - resource
Id 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>
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.