@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
124 lines • 5.25 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.SqlAlert = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* !> This resource is deprecated! Please switch to databricks_alert.
*
* This resource allows you to manage [Databricks SQL Alerts](https://docs.databricks.com/sql/user/queries/index.html).
*
* > To manage [SQLA resources](https://docs.databricks.com/sql/get-started/concepts.html) you must have `databricksSqlAccess` on your databricks.Group or databricks_user.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const sharedDir = new databricks.Directory("shared_dir", {path: "/Shared/Queries"});
* const _this = new databricks.SqlQuery("this", {
* dataSourceId: example.dataSourceId,
* name: "My Query Name",
* query: "SELECT 1 AS p1, 2 as p2",
* parent: pulumi.interpolate`folders/${sharedDir.objectId}`,
* });
* const alert = new databricks.SqlAlert("alert", {
* queryId: _this.id,
* name: "My Alert",
* parent: pulumi.interpolate`folders/${sharedDir.objectId}`,
* rearm: 1,
* options: {
* column: "p1",
* op: "==",
* value: "2",
* muted: false,
* },
* });
* ```
*
* ## Access Control
*
* databricks.Permissions can control which groups or individual users can *Manage*, *Edit*, *Run* or *View* individual alerts.
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.SqlQuery to manage Databricks SQL [Queries](https://docs.databricks.com/sql/user/queries/index.html).
* * databricks.SqlEndpoint to manage Databricks SQL [Endpoints](https://docs.databricks.com/sql/admin/sql-endpoints.html).
* * databricks.Directory to manage directories in [Databricks Workpace](https://docs.databricks.com/workspace/workspace-objects.html).
*
* ## Import
*
* This resource can be imported using alert ID:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/sqlAlert:SqlAlert this <alert-id>
* ```
*/
class SqlAlert extends pulumi.CustomResource {
/**
* Get an existing SqlAlert 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 SqlAlert(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SqlAlert. 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'] === SqlAlert.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["parent"] = state ? state.parent : undefined;
resourceInputs["queryId"] = state ? state.queryId : undefined;
resourceInputs["rearm"] = state ? state.rearm : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.options === undefined) && !opts.urn) {
throw new Error("Missing required property 'options'");
}
if ((!args || args.queryId === undefined) && !opts.urn) {
throw new Error("Missing required property 'queryId'");
}
resourceInputs["createdAt"] = args ? args.createdAt : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["options"] = args ? args.options : undefined;
resourceInputs["parent"] = args ? args.parent : undefined;
resourceInputs["queryId"] = args ? args.queryId : undefined;
resourceInputs["rearm"] = args ? args.rearm : undefined;
resourceInputs["updatedAt"] = args ? args.updatedAt : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SqlAlert.__pulumiType, name, resourceInputs, opts);
}
}
exports.SqlAlert = SqlAlert;
/** @internal */
SqlAlert.__pulumiType = 'databricks:index/sqlAlert:SqlAlert';
//# sourceMappingURL=sqlAlert.js.map
;