UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

119 lines 5.85 kB
"use strict"; // *** 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.Dashboard = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to manage Databricks [Dashboards](https://docs.databricks.com/en/dashboards/index.html). To manage [Dashboards](https://docs.databricks.com/en/dashboards/index.html) you must have a warehouse access on your databricks workspace. * * ## Example Usage * * Dashboard using `serializedDashboard` attribute: * * ```typescript * 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", * }); * ``` * * Dashboard using `filePath` attribute: * * ## Import * * You can import a `databricks_dashboard` resource with ID like the following: * * bash * * ```sh * $ pulumi import databricks:index/dashboard:Dashboard this <dashboard-id> * ``` */ class Dashboard extends pulumi.CustomResource { /** * Get an existing Dashboard 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 Dashboard(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Dashboard. 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'] === Dashboard.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["dashboardChangeDetected"] = state ? state.dashboardChangeDetected : undefined; resourceInputs["dashboardId"] = state ? state.dashboardId : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["embedCredentials"] = state ? state.embedCredentials : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["filePath"] = state ? state.filePath : undefined; resourceInputs["lifecycleState"] = state ? state.lifecycleState : undefined; resourceInputs["md5"] = state ? state.md5 : undefined; resourceInputs["parentPath"] = state ? state.parentPath : undefined; resourceInputs["path"] = state ? state.path : undefined; resourceInputs["serializedDashboard"] = state ? state.serializedDashboard : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; resourceInputs["warehouseId"] = state ? state.warehouseId : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.parentPath === undefined) && !opts.urn) { throw new Error("Missing required property 'parentPath'"); } if ((!args || args.warehouseId === undefined) && !opts.urn) { throw new Error("Missing required property 'warehouseId'"); } resourceInputs["createTime"] = args ? args.createTime : undefined; resourceInputs["dashboardChangeDetected"] = args ? args.dashboardChangeDetected : undefined; resourceInputs["dashboardId"] = args ? args.dashboardId : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["embedCredentials"] = args ? args.embedCredentials : undefined; resourceInputs["etag"] = args ? args.etag : undefined; resourceInputs["filePath"] = args ? args.filePath : undefined; resourceInputs["lifecycleState"] = args ? args.lifecycleState : undefined; resourceInputs["md5"] = args ? args.md5 : undefined; resourceInputs["parentPath"] = args ? args.parentPath : undefined; resourceInputs["path"] = args ? args.path : undefined; resourceInputs["serializedDashboard"] = args ? args.serializedDashboard : undefined; resourceInputs["updateTime"] = args ? args.updateTime : undefined; resourceInputs["warehouseId"] = args ? args.warehouseId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Dashboard.__pulumiType, name, resourceInputs, opts); } } exports.Dashboard = Dashboard; /** @internal */ Dashboard.__pulumiType = 'databricks:index/dashboard:Dashboard'; //# sourceMappingURL=dashboard.js.map