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

databricks.SqlWidget

Explore with Pulumi AI

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

    Note: Please switch to databricks.Dashboard to author new AI/BI dashboards using the latest tooling

    To manage SQL 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 widget is always tied to a Legacy dashboard. Every dashboard may have one or more widgets.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const d1w1 = new databricks.SqlWidget("d1w1", {
        dashboardId: d1.id,
        text: "Hello! I'm a **text widget**!",
        position: {
            sizeX: 3,
            sizeY: 4,
            posX: 0,
            posY: 0,
        },
    });
    const d1w2 = new databricks.SqlWidget("d1w2", {
        dashboardId: d1.id,
        visualizationId: q1v1.id,
        position: {
            sizeX: 3,
            sizeY: 4,
            posX: 3,
            posY: 0,
        },
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    d1w1 = databricks.SqlWidget("d1w1",
        dashboard_id=d1["id"],
        text="Hello! I'm a **text widget**!",
        position={
            "size_x": 3,
            "size_y": 4,
            "pos_x": 0,
            "pos_y": 0,
        })
    d1w2 = databricks.SqlWidget("d1w2",
        dashboard_id=d1["id"],
        visualization_id=q1v1["id"],
        position={
            "size_x": 3,
            "size_y": 4,
            "pos_x": 3,
            "pos_y": 0,
        })
    
    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.NewSqlWidget(ctx, "d1w1", &databricks.SqlWidgetArgs{
    			DashboardId: pulumi.Any(d1.Id),
    			Text:        pulumi.String("Hello! I'm a **text widget**!"),
    			Position: &databricks.SqlWidgetPositionArgs{
    				SizeX: pulumi.Int(3),
    				SizeY: pulumi.Int(4),
    				PosX:  pulumi.Int(0),
    				PosY:  pulumi.Int(0),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewSqlWidget(ctx, "d1w2", &databricks.SqlWidgetArgs{
    			DashboardId:     pulumi.Any(d1.Id),
    			VisualizationId: pulumi.Any(q1v1.Id),
    			Position: &databricks.SqlWidgetPositionArgs{
    				SizeX: pulumi.Int(3),
    				SizeY: pulumi.Int(4),
    				PosX:  pulumi.Int(3),
    				PosY:  pulumi.Int(0),
    			},
    		})
    		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 d1w1 = new Databricks.SqlWidget("d1w1", new()
        {
            DashboardId = d1.Id,
            Text = "Hello! I'm a **text widget**!",
            Position = new Databricks.Inputs.SqlWidgetPositionArgs
            {
                SizeX = 3,
                SizeY = 4,
                PosX = 0,
                PosY = 0,
            },
        });
    
        var d1w2 = new Databricks.SqlWidget("d1w2", new()
        {
            DashboardId = d1.Id,
            VisualizationId = q1v1.Id,
            Position = new Databricks.Inputs.SqlWidgetPositionArgs
            {
                SizeX = 3,
                SizeY = 4,
                PosX = 3,
                PosY = 0,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.SqlWidget;
    import com.pulumi.databricks.SqlWidgetArgs;
    import com.pulumi.databricks.inputs.SqlWidgetPositionArgs;
    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 d1w1 = new SqlWidget("d1w1", SqlWidgetArgs.builder()
                .dashboardId(d1.id())
                .text("Hello! I'm a **text widget**!")
                .position(SqlWidgetPositionArgs.builder()
                    .sizeX(3)
                    .sizeY(4)
                    .posX(0)
                    .posY(0)
                    .build())
                .build());
    
            var d1w2 = new SqlWidget("d1w2", SqlWidgetArgs.builder()
                .dashboardId(d1.id())
                .visualizationId(q1v1.id())
                .position(SqlWidgetPositionArgs.builder()
                    .sizeX(3)
                    .sizeY(4)
                    .posX(3)
                    .posY(0)
                    .build())
                .build());
    
        }
    }
    
    resources:
      d1w1:
        type: databricks:SqlWidget
        properties:
          dashboardId: ${d1.id}
          text: Hello! I'm a **text widget**!
          position:
            sizeX: 3
            sizeY: 4
            posX: 0
            posY: 0
      d1w2:
        type: databricks:SqlWidget
        properties:
          dashboardId: ${d1.id}
          visualizationId: ${q1v1.id}
          position:
            sizeX: 3
            sizeY: 4
            posX: 3
            posY: 0
    

    The following resources are often used in the same context:

    • End to end workspace management guide.
    • databricks.SqlDashboard to manage Databricks SQL Dashboards.
    • 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.

    Create SqlWidget Resource

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

    Constructor syntax

    new SqlWidget(name: string, args: SqlWidgetArgs, opts?: CustomResourceOptions);
    @overload
    def SqlWidget(resource_name: str,
                  args: SqlWidgetArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def SqlWidget(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  dashboard_id: Optional[str] = None,
                  description: Optional[str] = None,
                  parameters: Optional[Sequence[SqlWidgetParameterArgs]] = None,
                  position: Optional[SqlWidgetPositionArgs] = None,
                  text: Optional[str] = None,
                  title: Optional[str] = None,
                  visualization_id: Optional[str] = None,
                  widget_id: Optional[str] = None)
    func NewSqlWidget(ctx *Context, name string, args SqlWidgetArgs, opts ...ResourceOption) (*SqlWidget, error)
    public SqlWidget(string name, SqlWidgetArgs args, CustomResourceOptions? opts = null)
    public SqlWidget(String name, SqlWidgetArgs args)
    public SqlWidget(String name, SqlWidgetArgs args, CustomResourceOptions options)
    
    type: databricks:SqlWidget
    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 SqlWidgetArgs
    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 SqlWidgetArgs
    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 SqlWidgetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SqlWidgetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SqlWidgetArgs
    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 sqlWidgetResource = new Databricks.SqlWidget("sqlWidgetResource", new()
    {
        DashboardId = "string",
        Description = "string",
        Parameters = new[]
        {
            new Databricks.Inputs.SqlWidgetParameterArgs
            {
                Name = "string",
                Type = "string",
                MapTo = "string",
                Title = "string",
                Value = "string",
                Values = new[]
                {
                    "string",
                },
            },
        },
        Position = new Databricks.Inputs.SqlWidgetPositionArgs
        {
            SizeX = 0,
            SizeY = 0,
            AutoHeight = false,
            PosX = 0,
            PosY = 0,
        },
        Text = "string",
        Title = "string",
        VisualizationId = "string",
        WidgetId = "string",
    });
    
    example, err := databricks.NewSqlWidget(ctx, "sqlWidgetResource", &databricks.SqlWidgetArgs{
    	DashboardId: pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Parameters: databricks.SqlWidgetParameterArray{
    		&databricks.SqlWidgetParameterArgs{
    			Name:  pulumi.String("string"),
    			Type:  pulumi.String("string"),
    			MapTo: pulumi.String("string"),
    			Title: pulumi.String("string"),
    			Value: pulumi.String("string"),
    			Values: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	Position: &databricks.SqlWidgetPositionArgs{
    		SizeX:      pulumi.Int(0),
    		SizeY:      pulumi.Int(0),
    		AutoHeight: pulumi.Bool(false),
    		PosX:       pulumi.Int(0),
    		PosY:       pulumi.Int(0),
    	},
    	Text:            pulumi.String("string"),
    	Title:           pulumi.String("string"),
    	VisualizationId: pulumi.String("string"),
    	WidgetId:        pulumi.String("string"),
    })
    
    var sqlWidgetResource = new SqlWidget("sqlWidgetResource", SqlWidgetArgs.builder()
        .dashboardId("string")
        .description("string")
        .parameters(SqlWidgetParameterArgs.builder()
            .name("string")
            .type("string")
            .mapTo("string")
            .title("string")
            .value("string")
            .values("string")
            .build())
        .position(SqlWidgetPositionArgs.builder()
            .sizeX(0)
            .sizeY(0)
            .autoHeight(false)
            .posX(0)
            .posY(0)
            .build())
        .text("string")
        .title("string")
        .visualizationId("string")
        .widgetId("string")
        .build());
    
    sql_widget_resource = databricks.SqlWidget("sqlWidgetResource",
        dashboard_id="string",
        description="string",
        parameters=[databricks.SqlWidgetParameterArgs(
            name="string",
            type="string",
            map_to="string",
            title="string",
            value="string",
            values=["string"],
        )],
        position=databricks.SqlWidgetPositionArgs(
            size_x=0,
            size_y=0,
            auto_height=False,
            pos_x=0,
            pos_y=0,
        ),
        text="string",
        title="string",
        visualization_id="string",
        widget_id="string")
    
    const sqlWidgetResource = new databricks.SqlWidget("sqlWidgetResource", {
        dashboardId: "string",
        description: "string",
        parameters: [{
            name: "string",
            type: "string",
            mapTo: "string",
            title: "string",
            value: "string",
            values: ["string"],
        }],
        position: {
            sizeX: 0,
            sizeY: 0,
            autoHeight: false,
            posX: 0,
            posY: 0,
        },
        text: "string",
        title: "string",
        visualizationId: "string",
        widgetId: "string",
    });
    
    type: databricks:SqlWidget
    properties:
        dashboardId: string
        description: string
        parameters:
            - mapTo: string
              name: string
              title: string
              type: string
              value: string
              values:
                - string
        position:
            autoHeight: false
            posX: 0
            posY: 0
            sizeX: 0
            sizeY: 0
        text: string
        title: string
        visualizationId: string
        widgetId: string
    

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

    Outputs

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

    Get an existing SqlWidget 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?: SqlWidgetState, opts?: CustomResourceOptions): SqlWidget
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dashboard_id: Optional[str] = None,
            description: Optional[str] = None,
            parameters: Optional[Sequence[SqlWidgetParameterArgs]] = None,
            position: Optional[SqlWidgetPositionArgs] = None,
            text: Optional[str] = None,
            title: Optional[str] = None,
            visualization_id: Optional[str] = None,
            widget_id: Optional[str] = None) -> SqlWidget
    func GetSqlWidget(ctx *Context, name string, id IDInput, state *SqlWidgetState, opts ...ResourceOption) (*SqlWidget, error)
    public static SqlWidget Get(string name, Input<string> id, SqlWidgetState? state, CustomResourceOptions? opts = null)
    public static SqlWidget get(String name, Output<String> id, SqlWidgetState 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:

    Supporting Types

    SqlWidgetParameter, SqlWidgetParameterArgs

    Name string
    Type string
    MapTo string
    Title string
    Value string
    Values List<string>
    Name string
    Type string
    MapTo string
    Title string
    Value string
    Values []string
    name String
    type String
    mapTo String
    title String
    value String
    values List<String>
    name string
    type string
    mapTo string
    title string
    value string
    values string[]
    name str
    type str
    map_to str
    title str
    value str
    values Sequence[str]
    name String
    type String
    mapTo String
    title String
    value String
    values List<String>

    SqlWidgetPosition, SqlWidgetPositionArgs

    SizeX int
    SizeY int
    AutoHeight bool
    PosX int
    PosY int
    SizeX int
    SizeY int
    AutoHeight bool
    PosX int
    PosY int
    sizeX Integer
    sizeY Integer
    autoHeight Boolean
    posX Integer
    posY Integer
    sizeX number
    sizeY number
    autoHeight boolean
    posX number
    posY number
    sizeX Number
    sizeY Number
    autoHeight Boolean
    posX Number
    posY Number

    Import

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

    bash

    $ pulumi import databricks:index/sqlWidget:SqlWidget this <dashboard-id>/<widget-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