1. Packages
  2. Databricks
  3. API Docs
  4. Dashboard
Databricks v1.50.2 published on Tuesday, Sep 24, 2024 by Pulumi

databricks.Dashboard

Explore with Pulumi AI

databricks logo
Databricks v1.50.2 published on Tuesday, Sep 24, 2024 by Pulumi

    This resource allows you to manage Databricks Dashboards. To manage Dashboards you must have a warehouse access on your databricks workspace.

    Example Usage

    Dashboard using serialized_dashboard attribute:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const starter = databricks.getSqlWarehouse({
        name: "Starter Warehouse",
    });
    const dashboard = new databricks.Dashboard("dashboard", {
        displayName: "New Dashboard",
        warehouseId: starter.then(starter => starter.id),
        serializedDashboard: "{\"pages\":[{\"name\":\"new_name\",\"displayName\":\"New Page\"}]}",
        embedCredentials: false,
        parentPath: "/Shared/provider-test",
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    starter = databricks.get_sql_warehouse(name="Starter Warehouse")
    dashboard = databricks.Dashboard("dashboard",
        display_name="New Dashboard",
        warehouse_id=starter.id,
        serialized_dashboard="{\"pages\":[{\"name\":\"new_name\",\"displayName\":\"New Page\"}]}",
        embed_credentials=False,
        parent_path="/Shared/provider-test")
    
    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 {
    		starter, err := databricks.GetSqlWarehouse(ctx, &databricks.GetSqlWarehouseArgs{
    			Name: pulumi.StringRef("Starter Warehouse"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewDashboard(ctx, "dashboard", &databricks.DashboardArgs{
    			DisplayName:         pulumi.String("New Dashboard"),
    			WarehouseId:         pulumi.String(starter.Id),
    			SerializedDashboard: pulumi.String("{\"pages\":[{\"name\":\"new_name\",\"displayName\":\"New Page\"}]}"),
    			EmbedCredentials:    pulumi.Bool(false),
    			ParentPath:          pulumi.String("/Shared/provider-test"),
    		})
    		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 starter = Databricks.GetSqlWarehouse.Invoke(new()
        {
            Name = "Starter Warehouse",
        });
    
        var dashboard = new Databricks.Dashboard("dashboard", new()
        {
            DisplayName = "New Dashboard",
            WarehouseId = starter.Apply(getSqlWarehouseResult => getSqlWarehouseResult.Id),
            SerializedDashboard = "{\"pages\":[{\"name\":\"new_name\",\"displayName\":\"New Page\"}]}",
            EmbedCredentials = false,
            ParentPath = "/Shared/provider-test",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.DatabricksFunctions;
    import com.pulumi.databricks.inputs.GetSqlWarehouseArgs;
    import com.pulumi.databricks.Dashboard;
    import com.pulumi.databricks.DashboardArgs;
    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) {
            final var starter = DatabricksFunctions.getSqlWarehouse(GetSqlWarehouseArgs.builder()
                .name("Starter Warehouse")
                .build());
    
            var dashboard = new Dashboard("dashboard", DashboardArgs.builder()
                .displayName("New Dashboard")
                .warehouseId(starter.applyValue(getSqlWarehouseResult -> getSqlWarehouseResult.id()))
                .serializedDashboard("{\"pages\":[{\"name\":\"new_name\",\"displayName\":\"New Page\"}]}")
                .embedCredentials(false)
                .parentPath("/Shared/provider-test")
                .build());
    
        }
    }
    
    resources:
      dashboard:
        type: databricks:Dashboard
        properties:
          displayName: New Dashboard
          warehouseId: ${starter.id}
          serializedDashboard: '{"pages":[{"name":"new_name","displayName":"New Page"}]}'
          embedCredentials: false # Optional
          parentPath: /Shared/provider-test
    variables:
      starter:
        fn::invoke:
          Function: databricks:getSqlWarehouse
          Arguments:
            name: Starter Warehouse
    

    Dashboard using file_path attribute:

    Create Dashboard Resource

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

    Constructor syntax

    new Dashboard(name: string, args: DashboardArgs, opts?: CustomResourceOptions);
    @overload
    def Dashboard(resource_name: str,
                  args: DashboardArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def Dashboard(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  parent_path: Optional[str] = None,
                  display_name: Optional[str] = None,
                  warehouse_id: Optional[str] = None,
                  file_path: Optional[str] = None,
                  embed_credentials: Optional[bool] = None,
                  etag: Optional[str] = None,
                  dashboard_change_detected: Optional[bool] = None,
                  lifecycle_state: Optional[str] = None,
                  path: Optional[str] = None,
                  create_time: Optional[str] = None,
                  md5: Optional[str] = None,
                  serialized_dashboard: Optional[str] = None,
                  update_time: Optional[str] = None,
                  dashboard_id: Optional[str] = None)
    func NewDashboard(ctx *Context, name string, args DashboardArgs, opts ...ResourceOption) (*Dashboard, error)
    public Dashboard(string name, DashboardArgs args, CustomResourceOptions? opts = null)
    public Dashboard(String name, DashboardArgs args)
    public Dashboard(String name, DashboardArgs args, CustomResourceOptions options)
    
    type: databricks:Dashboard
    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 DashboardArgs
    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 DashboardArgs
    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 DashboardArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DashboardArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DashboardArgs
    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 dashboardResource = new Databricks.Dashboard("dashboardResource", new()
    {
        ParentPath = "string",
        DisplayName = "string",
        WarehouseId = "string",
        FilePath = "string",
        EmbedCredentials = false,
        Etag = "string",
        DashboardChangeDetected = false,
        LifecycleState = "string",
        Path = "string",
        CreateTime = "string",
        Md5 = "string",
        SerializedDashboard = "string",
        UpdateTime = "string",
        DashboardId = "string",
    });
    
    example, err := databricks.NewDashboard(ctx, "dashboardResource", &databricks.DashboardArgs{
    	ParentPath:              pulumi.String("string"),
    	DisplayName:             pulumi.String("string"),
    	WarehouseId:             pulumi.String("string"),
    	FilePath:                pulumi.String("string"),
    	EmbedCredentials:        pulumi.Bool(false),
    	Etag:                    pulumi.String("string"),
    	DashboardChangeDetected: pulumi.Bool(false),
    	LifecycleState:          pulumi.String("string"),
    	Path:                    pulumi.String("string"),
    	CreateTime:              pulumi.String("string"),
    	Md5:                     pulumi.String("string"),
    	SerializedDashboard:     pulumi.String("string"),
    	UpdateTime:              pulumi.String("string"),
    	DashboardId:             pulumi.String("string"),
    })
    
    var dashboardResource = new Dashboard("dashboardResource", DashboardArgs.builder()
        .parentPath("string")
        .displayName("string")
        .warehouseId("string")
        .filePath("string")
        .embedCredentials(false)
        .etag("string")
        .dashboardChangeDetected(false)
        .lifecycleState("string")
        .path("string")
        .createTime("string")
        .md5("string")
        .serializedDashboard("string")
        .updateTime("string")
        .dashboardId("string")
        .build());
    
    dashboard_resource = databricks.Dashboard("dashboardResource",
        parent_path="string",
        display_name="string",
        warehouse_id="string",
        file_path="string",
        embed_credentials=False,
        etag="string",
        dashboard_change_detected=False,
        lifecycle_state="string",
        path="string",
        create_time="string",
        md5="string",
        serialized_dashboard="string",
        update_time="string",
        dashboard_id="string")
    
    const dashboardResource = new databricks.Dashboard("dashboardResource", {
        parentPath: "string",
        displayName: "string",
        warehouseId: "string",
        filePath: "string",
        embedCredentials: false,
        etag: "string",
        dashboardChangeDetected: false,
        lifecycleState: "string",
        path: "string",
        createTime: "string",
        md5: "string",
        serializedDashboard: "string",
        updateTime: "string",
        dashboardId: "string",
    });
    
    type: databricks:Dashboard
    properties:
        createTime: string
        dashboardChangeDetected: false
        dashboardId: string
        displayName: string
        embedCredentials: false
        etag: string
        filePath: string
        lifecycleState: string
        md5: string
        parentPath: string
        path: string
        serializedDashboard: string
        updateTime: string
        warehouseId: string
    

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

    DisplayName string
    The display name of the dashboard.
    ParentPath string
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    WarehouseId string
    The warehouse ID used to run the dashboard.
    CreateTime string
    DashboardChangeDetected bool
    DashboardId string
    EmbedCredentials bool
    Whether to embed credentials in the dashboard. Default is true.
    Etag string
    FilePath string
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    LifecycleState string
    Md5 string
    Path string
    SerializedDashboard string
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    UpdateTime string
    DisplayName string
    The display name of the dashboard.
    ParentPath string
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    WarehouseId string
    The warehouse ID used to run the dashboard.
    CreateTime string
    DashboardChangeDetected bool
    DashboardId string
    EmbedCredentials bool
    Whether to embed credentials in the dashboard. Default is true.
    Etag string
    FilePath string
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    LifecycleState string
    Md5 string
    Path string
    SerializedDashboard string
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    UpdateTime string
    displayName String
    The display name of the dashboard.
    parentPath String
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    warehouseId String
    The warehouse ID used to run the dashboard.
    createTime String
    dashboardChangeDetected Boolean
    dashboardId String
    embedCredentials Boolean
    Whether to embed credentials in the dashboard. Default is true.
    etag String
    filePath String
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycleState String
    md5 String
    path String
    serializedDashboard String
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    updateTime String
    displayName string
    The display name of the dashboard.
    parentPath string
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    warehouseId string
    The warehouse ID used to run the dashboard.
    createTime string
    dashboardChangeDetected boolean
    dashboardId string
    embedCredentials boolean
    Whether to embed credentials in the dashboard. Default is true.
    etag string
    filePath string
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycleState string
    md5 string
    path string
    serializedDashboard string
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    updateTime string
    display_name str
    The display name of the dashboard.
    parent_path str
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    warehouse_id str
    The warehouse ID used to run the dashboard.
    create_time str
    dashboard_change_detected bool
    dashboard_id str
    embed_credentials bool
    Whether to embed credentials in the dashboard. Default is true.
    etag str
    file_path str
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycle_state str
    md5 str
    path str
    serialized_dashboard str
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    update_time str
    displayName String
    The display name of the dashboard.
    parentPath String
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    warehouseId String
    The warehouse ID used to run the dashboard.
    createTime String
    dashboardChangeDetected Boolean
    dashboardId String
    embedCredentials Boolean
    Whether to embed credentials in the dashboard. Default is true.
    etag String
    filePath String
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycleState String
    md5 String
    path String
    serializedDashboard String
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    updateTime String

    Outputs

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

    Get an existing Dashboard 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?: DashboardState, opts?: CustomResourceOptions): Dashboard
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            dashboard_change_detected: Optional[bool] = None,
            dashboard_id: Optional[str] = None,
            display_name: Optional[str] = None,
            embed_credentials: Optional[bool] = None,
            etag: Optional[str] = None,
            file_path: Optional[str] = None,
            lifecycle_state: Optional[str] = None,
            md5: Optional[str] = None,
            parent_path: Optional[str] = None,
            path: Optional[str] = None,
            serialized_dashboard: Optional[str] = None,
            update_time: Optional[str] = None,
            warehouse_id: Optional[str] = None) -> Dashboard
    func GetDashboard(ctx *Context, name string, id IDInput, state *DashboardState, opts ...ResourceOption) (*Dashboard, error)
    public static Dashboard Get(string name, Input<string> id, DashboardState? state, CustomResourceOptions? opts = null)
    public static Dashboard get(String name, Output<String> id, DashboardState 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:
    CreateTime string
    DashboardChangeDetected bool
    DashboardId string
    DisplayName string
    The display name of the dashboard.
    EmbedCredentials bool
    Whether to embed credentials in the dashboard. Default is true.
    Etag string
    FilePath string
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    LifecycleState string
    Md5 string
    ParentPath string
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    Path string
    SerializedDashboard string
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    UpdateTime string
    WarehouseId string
    The warehouse ID used to run the dashboard.
    CreateTime string
    DashboardChangeDetected bool
    DashboardId string
    DisplayName string
    The display name of the dashboard.
    EmbedCredentials bool
    Whether to embed credentials in the dashboard. Default is true.
    Etag string
    FilePath string
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    LifecycleState string
    Md5 string
    ParentPath string
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    Path string
    SerializedDashboard string
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    UpdateTime string
    WarehouseId string
    The warehouse ID used to run the dashboard.
    createTime String
    dashboardChangeDetected Boolean
    dashboardId String
    displayName String
    The display name of the dashboard.
    embedCredentials Boolean
    Whether to embed credentials in the dashboard. Default is true.
    etag String
    filePath String
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycleState String
    md5 String
    parentPath String
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    path String
    serializedDashboard String
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    updateTime String
    warehouseId String
    The warehouse ID used to run the dashboard.
    createTime string
    dashboardChangeDetected boolean
    dashboardId string
    displayName string
    The display name of the dashboard.
    embedCredentials boolean
    Whether to embed credentials in the dashboard. Default is true.
    etag string
    filePath string
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycleState string
    md5 string
    parentPath string
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    path string
    serializedDashboard string
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    updateTime string
    warehouseId string
    The warehouse ID used to run the dashboard.
    create_time str
    dashboard_change_detected bool
    dashboard_id str
    display_name str
    The display name of the dashboard.
    embed_credentials bool
    Whether to embed credentials in the dashboard. Default is true.
    etag str
    file_path str
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycle_state str
    md5 str
    parent_path str
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    path str
    serialized_dashboard str
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    update_time str
    warehouse_id str
    The warehouse ID used to run the dashboard.
    createTime String
    dashboardChangeDetected Boolean
    dashboardId String
    displayName String
    The display name of the dashboard.
    embedCredentials Boolean
    Whether to embed credentials in the dashboard. Default is true.
    etag String
    filePath String
    The path to the dashboard JSON file. Conflicts with serialized_dashboard.
    lifecycleState String
    md5 String
    parentPath String
    The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. If folder doesn't exist, it will be created.
    path String
    serializedDashboard String
    The contents of the dashboard in serialized string form. Conflicts with file_path.
    updateTime String
    warehouseId String
    The warehouse ID used to run the dashboard.

    Import

    You can import a databricks_dashboard resource with ID like the following:

    bash

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

    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.50.2 published on Tuesday, Sep 24, 2024 by Pulumi