databricks logo
Databricks v1.14.0, May 23 23

databricks.SqlDashboard

Explore with Pulumi AI

This resource is used to manage Databricks SQL Dashboards. To manage SQLA resources you must have databricks_sql_access on your databricks.Group or databricks_user.

Note: documentation for this resource is a work in progress.

A dashboard may have one or more widgets.

The following resources are often used in the same context:

  • End to end workspace management guide.
  • databricks.SqlEndpoint to manage Databricks SQL Endpoints.
  • databricks.SqlGlobalConfig to configure the security policy, databricks_instance_profile, and data access properties for all databricks.SqlEndpoint of workspace.
  • databricks.SqlPermissions to manage data object access control lists in Databricks workspaces for things like tables, views, databases, and more.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var sharedDir = new Databricks.Directory("sharedDir", new()
    {
        Path = "/Shared/Dashboards",
    });

    var d1 = new Databricks.SqlDashboard("d1", new()
    {
        Parent = sharedDir.ObjectId.Apply(objectId => $"folders/{objectId}"),
        Tags = new[]
        {
            "some-tag",
            "another-tag",
        },
    });

});
package main

import (
	"fmt"

	"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 {
		sharedDir, err := databricks.NewDirectory(ctx, "sharedDir", &databricks.DirectoryArgs{
			Path: pulumi.String("/Shared/Dashboards"),
		})
		if err != nil {
			return err
		}
		_, err = databricks.NewSqlDashboard(ctx, "d1", &databricks.SqlDashboardArgs{
			Parent: sharedDir.ObjectId.ApplyT(func(objectId int) (string, error) {
				return fmt.Sprintf("folders/%v", objectId), nil
			}).(pulumi.StringOutput),
			Tags: pulumi.StringArray{
				pulumi.String("some-tag"),
				pulumi.String("another-tag"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.Directory;
import com.pulumi.databricks.DirectoryArgs;
import com.pulumi.databricks.SqlDashboard;
import com.pulumi.databricks.SqlDashboardArgs;
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 sharedDir = new Directory("sharedDir", DirectoryArgs.builder()        
            .path("/Shared/Dashboards")
            .build());

        var d1 = new SqlDashboard("d1", SqlDashboardArgs.builder()        
            .parent(sharedDir.objectId().applyValue(objectId -> String.format("folders/%s", objectId)))
            .tags(            
                "some-tag",
                "another-tag")
            .build());

    }
}
import pulumi
import pulumi_databricks as databricks

shared_dir = databricks.Directory("sharedDir", path="/Shared/Dashboards")
d1 = databricks.SqlDashboard("d1",
    parent=shared_dir.object_id.apply(lambda object_id: f"folders/{object_id}"),
    tags=[
        "some-tag",
        "another-tag",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const sharedDir = new databricks.Directory("sharedDir", {path: "/Shared/Dashboards"});
const d1 = new databricks.SqlDashboard("d1", {
    parent: pulumi.interpolate`folders/${sharedDir.objectId}`,
    tags: [
        "some-tag",
        "another-tag",
    ],
});
resources:
  sharedDir:
    type: databricks:Directory
    properties:
      path: /Shared/Dashboards
  d1:
    type: databricks:SqlDashboard
    properties:
      parent: folders/${sharedDir.objectId}
      tags:
        - some-tag
        - another-tag

Example permission to share dashboard with all users

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var d1 = new Databricks.Permissions("d1", new()
    {
        SqlDashboardId = databricks_sql_dashboard.D1.Id,
        AccessControls = new[]
        {
            new Databricks.Inputs.PermissionsAccessControlArgs
            {
                GroupName = data.Databricks_group.Users.Display_name,
                PermissionLevel = "CAN_RUN",
            },
        },
    });

});
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.NewPermissions(ctx, "d1", &databricks.PermissionsArgs{
			SqlDashboardId: pulumi.Any(databricks_sql_dashboard.D1.Id),
			AccessControls: databricks.PermissionsAccessControlArray{
				&databricks.PermissionsAccessControlArgs{
					GroupName:       pulumi.Any(data.Databricks_group.Users.Display_name),
					PermissionLevel: pulumi.String("CAN_RUN"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.Permissions;
import com.pulumi.databricks.PermissionsArgs;
import com.pulumi.databricks.inputs.PermissionsAccessControlArgs;
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 d1 = new Permissions("d1", PermissionsArgs.builder()        
            .sqlDashboardId(databricks_sql_dashboard.d1().id())
            .accessControls(PermissionsAccessControlArgs.builder()
                .groupName(data.databricks_group().users().display_name())
                .permissionLevel("CAN_RUN")
                .build())
            .build());

    }
}
import pulumi
import pulumi_databricks as databricks

d1 = databricks.Permissions("d1",
    sql_dashboard_id=databricks_sql_dashboard["d1"]["id"],
    access_controls=[databricks.PermissionsAccessControlArgs(
        group_name=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        permission_level="CAN_RUN",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const d1 = new databricks.Permissions("d1", {
    sqlDashboardId: databricks_sql_dashboard.d1.id,
    accessControls: [{
        groupName: data.databricks_group.users.display_name,
        permissionLevel: "CAN_RUN",
    }],
});
resources:
  d1:
    type: databricks:Permissions
    properties:
      sqlDashboardId: ${databricks_sql_dashboard.d1.id}
      accessControls:
        - groupName: ${data.databricks_group.users.display_name}
          permissionLevel: CAN_RUN

Create SqlDashboard Resource

new SqlDashboard(name: string, args?: SqlDashboardArgs, opts?: CustomResourceOptions);
@overload
def SqlDashboard(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 name: Optional[str] = None,
                 parent: Optional[str] = None,
                 tags: Optional[Sequence[str]] = None)
@overload
def SqlDashboard(resource_name: str,
                 args: Optional[SqlDashboardArgs] = None,
                 opts: Optional[ResourceOptions] = None)
func NewSqlDashboard(ctx *Context, name string, args *SqlDashboardArgs, opts ...ResourceOption) (*SqlDashboard, error)
public SqlDashboard(string name, SqlDashboardArgs? args = null, CustomResourceOptions? opts = null)
public SqlDashboard(String name, SqlDashboardArgs args)
public SqlDashboard(String name, SqlDashboardArgs args, CustomResourceOptions options)
type: databricks:SqlDashboard
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SqlDashboardArgs
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 SqlDashboardArgs
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 SqlDashboardArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SqlDashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SqlDashboardArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Name string
Parent string
Tags List<string>
Name string
Parent string
Tags []string
name String
parent String
tags List<String>
name string
parent string
tags string[]
name str
parent str
tags Sequence[str]
name String
parent String
tags List<String>

Outputs

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

Get an existing SqlDashboard 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?: SqlDashboardState, opts?: CustomResourceOptions): SqlDashboard
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        parent: Optional[str] = None,
        tags: Optional[Sequence[str]] = None) -> SqlDashboard
func GetSqlDashboard(ctx *Context, name string, id IDInput, state *SqlDashboardState, opts ...ResourceOption) (*SqlDashboard, error)
public static SqlDashboard Get(string name, Input<string> id, SqlDashboardState? state, CustomResourceOptions? opts = null)
public static SqlDashboard get(String name, Output<String> id, SqlDashboardState 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:
Name string
Parent string
Tags List<string>
Name string
Parent string
Tags []string
name String
parent String
tags List<String>
name string
parent string
tags string[]
name str
parent str
tags Sequence[str]
name String
parent String
tags List<String>

Import

You can import a databricks_sql_dashboard resource with ID like the followingbash

 $ pulumi import databricks:index/sqlDashboard:SqlDashboard this <dashboard-id>

Package Details

Repository
databricks pulumi/pulumi-databricks
License
Apache-2.0
Notes

This Pulumi package is based on the databricks Terraform Provider.