@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
137 lines • 5.24 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SqlWidget = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* !> 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 [SQL resources](https://docs.databricks.com/sql/get-started/concepts.html) you must have `databricksSqlAccess` on your databricks.Group or databricks_user.
*
* > 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
*
* ```typescript
* 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,
* },
* });
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.SqlDashboard to manage Databricks SQL [Dashboards](https://docs.databricks.com/sql/user/dashboards/index.html).
* * databricks.SqlEndpoint to manage Databricks SQL [Endpoints](https://docs.databricks.com/sql/admin/sql-endpoints.html).
* * databricks.SqlGlobalConfig to configure the security policy, databricks_instance_profile, and [data access properties](https://docs.databricks.com/sql/admin/data-access-configuration.html) for all databricks.SqlEndpoint of workspace.
* * databricks.Grants to manage data access in Unity Catalog.
*
* ## Import
*
* You can import a `databricks_sql_widget` resource with ID like the following:
*
* hcl
*
* import {
*
* to = databricks_sql_widget.this
*
* id = "<dashboard-id>/<widget-id>"
*
* }
*
* Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/sqlWidget:SqlWidget this <dashboard-id>/<widget-id>
* ```
*/
class SqlWidget extends pulumi.CustomResource {
/**
* Get an existing SqlWidget resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new SqlWidget(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SqlWidget. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SqlWidget.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["dashboardId"] = state?.dashboardId;
resourceInputs["description"] = state?.description;
resourceInputs["parameters"] = state?.parameters;
resourceInputs["position"] = state?.position;
resourceInputs["text"] = state?.text;
resourceInputs["title"] = state?.title;
resourceInputs["visualizationId"] = state?.visualizationId;
resourceInputs["widgetId"] = state?.widgetId;
}
else {
const args = argsOrState;
if (args?.dashboardId === undefined && !opts.urn) {
throw new Error("Missing required property 'dashboardId'");
}
resourceInputs["dashboardId"] = args?.dashboardId;
resourceInputs["description"] = args?.description;
resourceInputs["parameters"] = args?.parameters;
resourceInputs["position"] = args?.position;
resourceInputs["text"] = args?.text;
resourceInputs["title"] = args?.title;
resourceInputs["visualizationId"] = args?.visualizationId;
resourceInputs["widgetId"] = args?.widgetId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SqlWidget.__pulumiType, name, resourceInputs, opts);
}
}
exports.SqlWidget = SqlWidget;
/** @internal */
SqlWidget.__pulumiType = 'databricks:index/sqlWidget:SqlWidget';
//# sourceMappingURL=sqlWidget.js.map