1. Packages
  2. Databricks
  3. API Docs
  4. SecretAcl
Databricks v1.46.1 published on Friday, Jun 28, 2024 by Pulumi

databricks.SecretAcl

Explore with Pulumi AI

databricks logo
Databricks v1.46.1 published on Friday, Jun 28, 2024 by Pulumi

    Create or overwrite the ACL associated with the given principal (user or group) on the specified databricks_secret_scope. Please consult Secrets User Guide for more details.

    Example Usage

    This way, data scientists can read the Publishing API key that is synchronized from, for example, Azure Key Vault.

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const ds = new databricks.Group("ds", {displayName: "data-scientists"});
    const app = new databricks.SecretScope("app", {name: "app-secret-scope"});
    const mySecretAcl = new databricks.SecretAcl("my_secret_acl", {
        principal: ds.displayName,
        permission: "READ",
        scope: app.name,
    });
    const publishingApi = new databricks.Secret("publishing_api", {
        key: "publishing_api",
        stringValue: example.value,
        scope: app.name,
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    ds = databricks.Group("ds", display_name="data-scientists")
    app = databricks.SecretScope("app", name="app-secret-scope")
    my_secret_acl = databricks.SecretAcl("my_secret_acl",
        principal=ds.display_name,
        permission="READ",
        scope=app.name)
    publishing_api = databricks.Secret("publishing_api",
        key="publishing_api",
        string_value=example["value"],
        scope=app.name)
    
    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 {
    		ds, err := databricks.NewGroup(ctx, "ds", &databricks.GroupArgs{
    			DisplayName: pulumi.String("data-scientists"),
    		})
    		if err != nil {
    			return err
    		}
    		app, err := databricks.NewSecretScope(ctx, "app", &databricks.SecretScopeArgs{
    			Name: pulumi.String("app-secret-scope"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewSecretAcl(ctx, "my_secret_acl", &databricks.SecretAclArgs{
    			Principal:  ds.DisplayName,
    			Permission: pulumi.String("READ"),
    			Scope:      app.Name,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewSecret(ctx, "publishing_api", &databricks.SecretArgs{
    			Key:         pulumi.String("publishing_api"),
    			StringValue: pulumi.Any(example.Value),
    			Scope:       app.Name,
    		})
    		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 ds = new Databricks.Group("ds", new()
        {
            DisplayName = "data-scientists",
        });
    
        var app = new Databricks.SecretScope("app", new()
        {
            Name = "app-secret-scope",
        });
    
        var mySecretAcl = new Databricks.SecretAcl("my_secret_acl", new()
        {
            Principal = ds.DisplayName,
            Permission = "READ",
            Scope = app.Name,
        });
    
        var publishingApi = new Databricks.Secret("publishing_api", new()
        {
            Key = "publishing_api",
            StringValue = example.Value,
            Scope = app.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.Group;
    import com.pulumi.databricks.GroupArgs;
    import com.pulumi.databricks.SecretScope;
    import com.pulumi.databricks.SecretScopeArgs;
    import com.pulumi.databricks.SecretAcl;
    import com.pulumi.databricks.SecretAclArgs;
    import com.pulumi.databricks.Secret;
    import com.pulumi.databricks.SecretArgs;
    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 ds = new Group("ds", GroupArgs.builder()
                .displayName("data-scientists")
                .build());
    
            var app = new SecretScope("app", SecretScopeArgs.builder()
                .name("app-secret-scope")
                .build());
    
            var mySecretAcl = new SecretAcl("mySecretAcl", SecretAclArgs.builder()
                .principal(ds.displayName())
                .permission("READ")
                .scope(app.name())
                .build());
    
            var publishingApi = new Secret("publishingApi", SecretArgs.builder()
                .key("publishing_api")
                .stringValue(example.value())
                .scope(app.name())
                .build());
    
        }
    }
    
    resources:
      ds:
        type: databricks:Group
        properties:
          displayName: data-scientists
      app:
        type: databricks:SecretScope
        properties:
          name: app-secret-scope
      mySecretAcl:
        type: databricks:SecretAcl
        name: my_secret_acl
        properties:
          principal: ${ds.displayName}
          permission: READ
          scope: ${app.name}
      publishingApi:
        type: databricks:Secret
        name: publishing_api
        properties:
          key: publishing_api
          stringValue: ${example.value}
          scope: ${app.name}
    

    The following resources are often used in the same context:

    Create SecretAcl Resource

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

    Constructor syntax

    new SecretAcl(name: string, args: SecretAclArgs, opts?: CustomResourceOptions);
    @overload
    def SecretAcl(resource_name: str,
                  args: SecretAclArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecretAcl(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  permission: Optional[str] = None,
                  principal: Optional[str] = None,
                  scope: Optional[str] = None)
    func NewSecretAcl(ctx *Context, name string, args SecretAclArgs, opts ...ResourceOption) (*SecretAcl, error)
    public SecretAcl(string name, SecretAclArgs args, CustomResourceOptions? opts = null)
    public SecretAcl(String name, SecretAclArgs args)
    public SecretAcl(String name, SecretAclArgs args, CustomResourceOptions options)
    
    type: databricks:SecretAcl
    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 SecretAclArgs
    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 SecretAclArgs
    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 SecretAclArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretAclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretAclArgs
    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 secretAclResource = new Databricks.SecretAcl("secretAclResource", new()
    {
        Permission = "string",
        Principal = "string",
        Scope = "string",
    });
    
    example, err := databricks.NewSecretAcl(ctx, "secretAclResource", &databricks.SecretAclArgs{
    	Permission: pulumi.String("string"),
    	Principal:  pulumi.String("string"),
    	Scope:      pulumi.String("string"),
    })
    
    var secretAclResource = new SecretAcl("secretAclResource", SecretAclArgs.builder()
        .permission("string")
        .principal("string")
        .scope("string")
        .build());
    
    secret_acl_resource = databricks.SecretAcl("secretAclResource",
        permission="string",
        principal="string",
        scope="string")
    
    const secretAclResource = new databricks.SecretAcl("secretAclResource", {
        permission: "string",
        principal: "string",
        scope: "string",
    });
    
    type: databricks:SecretAcl
    properties:
        permission: string
        principal: string
        scope: string
    

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

    Permission string
    READ, WRITE or MANAGE.
    Principal string
    principal's identifier. It can be:
    Scope string
    name of the scope
    Permission string
    READ, WRITE or MANAGE.
    Principal string
    principal's identifier. It can be:
    Scope string
    name of the scope
    permission String
    READ, WRITE or MANAGE.
    principal String
    principal's identifier. It can be:
    scope String
    name of the scope
    permission string
    READ, WRITE or MANAGE.
    principal string
    principal's identifier. It can be:
    scope string
    name of the scope
    permission str
    READ, WRITE or MANAGE.
    principal str
    principal's identifier. It can be:
    scope str
    name of the scope
    permission String
    READ, WRITE or MANAGE.
    principal String
    principal's identifier. It can be:
    scope String
    name of the scope

    Outputs

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

    Get an existing SecretAcl 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?: SecretAclState, opts?: CustomResourceOptions): SecretAcl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            permission: Optional[str] = None,
            principal: Optional[str] = None,
            scope: Optional[str] = None) -> SecretAcl
    func GetSecretAcl(ctx *Context, name string, id IDInput, state *SecretAclState, opts ...ResourceOption) (*SecretAcl, error)
    public static SecretAcl Get(string name, Input<string> id, SecretAclState? state, CustomResourceOptions? opts = null)
    public static SecretAcl get(String name, Output<String> id, SecretAclState 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:
    Permission string
    READ, WRITE or MANAGE.
    Principal string
    principal's identifier. It can be:
    Scope string
    name of the scope
    Permission string
    READ, WRITE or MANAGE.
    Principal string
    principal's identifier. It can be:
    Scope string
    name of the scope
    permission String
    READ, WRITE or MANAGE.
    principal String
    principal's identifier. It can be:
    scope String
    name of the scope
    permission string
    READ, WRITE or MANAGE.
    principal string
    principal's identifier. It can be:
    scope string
    name of the scope
    permission str
    READ, WRITE or MANAGE.
    principal str
    principal's identifier. It can be:
    scope str
    name of the scope
    permission String
    READ, WRITE or MANAGE.
    principal String
    principal's identifier. It can be:
    scope String
    name of the scope

    Import

    The resource secret acl can be imported using scopeName|||principalName combination.

    bash

    $ pulumi import databricks:index/secretAcl:SecretAcl object `scopeName|||principalName`
    

    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.46.1 published on Friday, Jun 28, 2024 by Pulumi