@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
123 lines • 5.48 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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");
/**
* > 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.SqlPermissions to manage data object access control lists in Databricks workspaces for things like tables, views, databases, and [more](https://docs.databricks.com/security/access-control/table-acls/object-privileges.html).
*
* ## Import
*
* You can import a `databricks_sql_widget` resource with ID like the following:
*
* 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, Object.assign(Object.assign({}, 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 ? state.dashboardId : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["position"] = state ? state.position : undefined;
resourceInputs["text"] = state ? state.text : undefined;
resourceInputs["title"] = state ? state.title : undefined;
resourceInputs["visualizationId"] = state ? state.visualizationId : undefined;
resourceInputs["widgetId"] = state ? state.widgetId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.dashboardId === undefined) && !opts.urn) {
throw new Error("Missing required property 'dashboardId'");
}
resourceInputs["dashboardId"] = args ? args.dashboardId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["position"] = args ? args.position : undefined;
resourceInputs["text"] = args ? args.text : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["visualizationId"] = args ? args.visualizationId : undefined;
resourceInputs["widgetId"] = args ? args.widgetId : undefined;
}
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
;