!> This resource is deprecated and will be removed in future.
Please switch to databricks.Dashboard to author new AI/BI dashboards using the latest tooling
To manage SQLA resources you must have databricks_sql_access on your databricks.Group or databricks_user.
documentation for this resource is a work in progress.
A visualization is always tied to a query. Every query may have one or more visualizations.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const q1v1 = new databricks.SqlVisualization("q1v1", {
queryId: q1.id,
type: "table",
name: "My Table",
description: "Some Description",
options: JSON.stringify({
itemsPerPage: 25,
columns: [
{
name: "p1",
type: "string",
title: "Parameter 1",
displayAs: "string",
},
{
name: "p2",
type: "string",
title: "Parameter 2",
displayAs: "link",
highlightLinks: true,
},
],
}),
});
import pulumi
import json
import pulumi_databricks as databricks
q1v1 = databricks.SqlVisualization("q1v1",
query_id=q1["id"],
type="table",
name="My Table",
description="Some Description",
options=json.dumps({
"itemsPerPage": 25,
"columns": [
{
"name": "p1",
"type": "string",
"title": "Parameter 1",
"displayAs": "string",
},
{
"name": "p2",
"type": "string",
"title": "Parameter 2",
"displayAs": "link",
"highlightLinks": True,
},
],
}))
package main
import (
"encoding/json"
"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 {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"itemsPerPage": 25,
"columns": []map[string]interface{}{
map[string]interface{}{
"name": "p1",
"type": "string",
"title": "Parameter 1",
"displayAs": "string",
},
map[string]interface{}{
"name": "p2",
"type": "string",
"title": "Parameter 2",
"displayAs": "link",
"highlightLinks": true,
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = databricks.NewSqlVisualization(ctx, "q1v1", &databricks.SqlVisualizationArgs{
QueryId: pulumi.Any(q1.Id),
Type: pulumi.String("table"),
Name: pulumi.String("My Table"),
Description: pulumi.String("Some Description"),
Options: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var q1v1 = new Databricks.SqlVisualization("q1v1", new()
{
QueryId = q1.Id,
Type = "table",
Name = "My Table",
Description = "Some Description",
Options = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["itemsPerPage"] = 25,
["columns"] = new[]
{
new Dictionary<string, object?>
{
["name"] = "p1",
["type"] = "string",
["title"] = "Parameter 1",
["displayAs"] = "string",
},
new Dictionary<string, object?>
{
["name"] = "p2",
["type"] = "string",
["title"] = "Parameter 2",
["displayAs"] = "link",
["highlightLinks"] = true,
},
},
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.SqlVisualization;
import com.pulumi.databricks.SqlVisualizationArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 q1v1 = new SqlVisualization("q1v1", SqlVisualizationArgs.builder()
.queryId(q1.id())
.type("table")
.name("My Table")
.description("Some Description")
.options(serializeJson(
jsonObject(
jsonProperty("itemsPerPage", 25),
jsonProperty("columns", jsonArray(
jsonObject(
jsonProperty("name", "p1"),
jsonProperty("type", "string"),
jsonProperty("title", "Parameter 1"),
jsonProperty("displayAs", "string")
),
jsonObject(
jsonProperty("name", "p2"),
jsonProperty("type", "string"),
jsonProperty("title", "Parameter 2"),
jsonProperty("displayAs", "link"),
jsonProperty("highlightLinks", true)
)
))
)))
.build());
}
}
resources:
q1v1:
type: databricks:SqlVisualization
properties:
queryId: ${q1.id}
type: table
name: My Table
description: Some Description
options:
fn::toJSON:
itemsPerPage: 25
columns:
- name: p1
type: string
title: Parameter 1
displayAs: string
- name: p2
type: string
title: Parameter 2
displayAs: link
highlightLinks: true
Separating visualization definition from IAC configuration
Since options field contains the full JSON encoded string definition of how to render a visualization for the backend API - sql/api/visualizations, they can get quite verbose.
If you have lots of visualizations to declare, it might be cleaner to separate the options field and store them as separate .json files to be referenced.
Example
directory tree
. ├── q1vx.tf └── visualizations ├── q1v1.json └── q1v2.json
- resource definitions
## Create SqlVisualization Resource {#create}
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see [Resources](/docs/concepts/resources/).
### Constructor syntax
<div>
<pulumi-chooser type="language" options="csharp,go,typescript,python,yaml,java"></pulumi-chooser>
</div>
<div>
<pulumi-choosable type="language" values="javascript,typescript">
<div class="no-copy"><div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">SqlVisualization</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">SqlVisualizationArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
</div></pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="python">
<div class="no-copy"><div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
<span class="k">def </span><span class="nx">SqlVisualization</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
<span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">SqlVisualizationArgs</a></span><span class="p">,</span>
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">)</span>
<span></span>
<span class=nd>@overload</span>
<span class="k">def </span><span class="nx">SqlVisualization</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
<span class="nx">options</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">query_id</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">type</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">description</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">name</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">query_plan</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">visualization_id</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">)</span></code></pre></div>
</div></pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="go">
<div class="no-copy"><div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewSqlVisualization</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> </span><span class="nx"><a href="#inputs">SqlVisualizationArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">SqlVisualization</span>, error)</span></code></pre></div>
</div></pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="csharp">
<div class="no-copy"><div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">SqlVisualization</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">SqlVisualizationArgs</a></span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
</div></pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="java">
<div class="no-copy"><div class="highlight"><pre class="chroma">
<code class="language-java" data-lang="java"><span class="k">public </span><span class="nx">SqlVisualization</span><span class="p">(</span><span class="nx">String</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">SqlVisualizationArgs</a></span><span class="p"> </span><span class="nx">args<span class="p">)</span>
<span class="k">public </span><span class="nx">SqlVisualization</span><span class="p">(</span><span class="nx">String</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">SqlVisualizationArgs</a></span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx">CustomResourceOptions</span><span class="p"> </span><span class="nx">options<span class="p">)</span>
</code></pre></div></div>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="yaml">
<div class="no-copy"><div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">type: <span class="nx">databricks:SqlVisualization</span><span class="p"></span>
<span class="p">properties</span><span class="p">: </span><span class="c"># The arguments to resource properties.</span>
<span class="p"></span><span class="p">options</span><span class="p">: </span><span class="c"># Bag of options to control resource's behavior.</span>
<span class="p"></span>
</code></pre></div></div>
</pulumi-choosable>
</div>
#### Parameters
<div>
<pulumi-choosable type="language" values="javascript,typescript">
<dl class="resources-properties"><dt
class="property-required" title="Required">
<span>name</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>The unique name of the resource.</dd><dt
class="property-required" title="Required">
<span>args</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#inputs">SqlVisualizationArgs</a></span>
</dt>
<dd>The arguments to resource properties.</dd><dt
class="property-optional" title="Optional">
<span>opts</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
</dt>
<dd>Bag of options to control resource's behavior.</dd></dl>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="python">
<dl class="resources-properties"><dt
class="property-required" title="Required">
<span>resource_name</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>The unique name of the resource.</dd><dt
class="property-required" title="Required">
<span>args</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#inputs">SqlVisualizationArgs</a></span>
</dt>
<dd>The arguments to resource properties.</dd><dt
class="property-optional" title="Optional">
<span>opts</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
</dt>
<dd>Bag of options to control resource's behavior.</dd></dl>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="go">
<dl class="resources-properties"><dt
class="property-optional" title="Optional">
<span>ctx</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
</dt>
<dd>Context object for the current deployment.</dd><dt
class="property-required" title="Required">
<span>name</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>The unique name of the resource.</dd><dt
class="property-required" title="Required">
<span>args</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#inputs">SqlVisualizationArgs</a></span>
</dt>
<dd>The arguments to resource properties.</dd><dt
class="property-optional" title="Optional">
<span>opts</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
</dt>
<dd>Bag of options to control resource's behavior.</dd></dl>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="csharp">
<dl class="resources-properties"><dt
class="property-required" title="Required">
<span>name</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>The unique name of the resource.</dd><dt
class="property-required" title="Required">
<span>args</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#inputs">SqlVisualizationArgs</a></span>
</dt>
<dd>The arguments to resource properties.</dd><dt
class="property-optional" title="Optional">
<span>opts</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
</dt>
<dd>Bag of options to control resource's behavior.</dd></dl>
</pulumi-choosable>
</div>
<div>
<pulumi-choosable type="language" values="java">
<dl class="resources-properties"><dt
class="property-required" title="Required">
<span>name</span>
<span class="property-indicator"></span>
<span class="property-type">String</span>
</dt>
<dd>The unique name of the resource.</dd><dt
class="property-required" title="Required">
<span>args</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#inputs">SqlVisualizationArgs</a></span>
</dt>
<dd>The arguments to resource properties.</dd><dt
class="property-optional" title="Optional">
<span>options</span>
<span class="property-indicator"></span>
<span class="property-type">CustomResourceOptions</span>
</dt>
<dd>Bag of options to control resource's behavior.</dd></dl>
</pulumi-choosable>
</div>
### Constructor example
The following reference example uses placeholder values for all [input properties](#inputs).
<div>
<pulumi-chooser type="language" options="csharp,go,typescript,python,yaml,java"></pulumi-chooser>
</div>
<div>
<pulumi-choosable type="language" values="csharp">
```csharp
var sqlVisualizationResource = new Databricks.SqlVisualization("sqlVisualizationResource", new()
{
Options = "string",
QueryId = "string",
Type = "string",
Description = "string",
Name = "string",
QueryPlan = "string",
VisualizationId = "string",
});
example, err := databricks.NewSqlVisualization(ctx, "sqlVisualizationResource", &databricks.SqlVisualizationArgs{
Options: pulumi.String("string"),
QueryId: pulumi.String("string"),
Type: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
QueryPlan: pulumi.String("string"),
VisualizationId: pulumi.String("string"),
})
var sqlVisualizationResource = new SqlVisualization("sqlVisualizationResource", SqlVisualizationArgs.builder()
.options("string")
.queryId("string")
.type("string")
.description("string")
.name("string")
.queryPlan("string")
.visualizationId("string")
.build());
sql_visualization_resource = databricks.SqlVisualization("sqlVisualizationResource",
options="string",
query_id="string",
type="string",
description="string",
name="string",
query_plan="string",
visualization_id="string")
const sqlVisualizationResource = new databricks.SqlVisualization("sqlVisualizationResource", {
options: "string",
queryId: "string",
type: "string",
description: "string",
name: "string",
queryPlan: "string",
visualizationId: "string",
});
type: databricks:SqlVisualization
properties:
description: string
name: string
options: string
queryId: string
queryPlan: string
type: string
visualizationId: string
SqlVisualization Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The SqlVisualization resource accepts the following input properties:
- Options string
- Query
Id string - Type string
- Description string
- Name string
- Query
Plan string - Visualization
Id string
- Options string
- Query
Id string - Type string
- Description string
- Name string
- Query
Plan string - Visualization
Id string
- options String
- query
Id String - type String
- description String
- name String
- query
Plan String - visualization
Id String
- options string
- query
Id string - type string
- description string
- name string
- query
Plan string - visualization
Id string
- options str
- query_
id str - type str
- description str
- name str
- query_
plan str - visualization_
id str
- options String
- query
Id String - type String
- description String
- name String
- query
Plan String - visualization
Id String
Outputs
All input properties are implicitly available as output properties. Additionally, the SqlVisualization 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 SqlVisualization Resource
Get an existing SqlVisualization 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?: SqlVisualizationState, opts?: CustomResourceOptions): SqlVisualization@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
options: Optional[str] = None,
query_id: Optional[str] = None,
query_plan: Optional[str] = None,
type: Optional[str] = None,
visualization_id: Optional[str] = None) -> SqlVisualizationfunc GetSqlVisualization(ctx *Context, name string, id IDInput, state *SqlVisualizationState, opts ...ResourceOption) (*SqlVisualization, error)public static SqlVisualization Get(string name, Input<string> id, SqlVisualizationState? state, CustomResourceOptions? opts = null)public static SqlVisualization get(String name, Output<String> id, SqlVisualizationState state, CustomResourceOptions options)resources: _: type: databricks:SqlVisualization get: id: ${id}- 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.
- Description string
- Name string
- Options string
- Query
Id string - Query
Plan string - Type string
- Visualization
Id string
- Description string
- Name string
- Options string
- Query
Id string - Query
Plan string - Type string
- Visualization
Id string
- description String
- name String
- options String
- query
Id String - query
Plan String - type String
- visualization
Id String
- description string
- name string
- options string
- query
Id string - query
Plan string - type string
- visualization
Id string
- description str
- name str
- options str
- query_
id str - query_
plan str - type str
- visualization_
id str
- description String
- name String
- options String
- query
Id String - query
Plan String - type String
- visualization
Id String
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
