@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
272 lines (271 loc) • 11 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* [](https://docs.databricks.com/aws/en/release-notes/release-types)
*
* The Alert v2 resource allows you to manage SQL alerts in Databricks SQL. Alerts monitor query results and notify you when specific conditions are met.
*
* Alerts run on a schedule and evaluate query results against defined thresholds. When an alert is triggered, notifications can be sent to specified users or destinations.
*
* ## Example Usage
*
* ### Basic Alert Example
* This example creates a basic alert that monitors a query and sends notifications to a user when the value exceeds a threshold:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const basicAlert = new databricks.AlertV2("basic_alert", {
* displayName: "High Error Rate Alert",
* queryText: "SELECT count(*) as error_count FROM logs WHERE level = 'ERROR' AND timestamp > now() - interval 1 hour",
* warehouseId: "a7066a8ef796be84",
* parentPath: "/Users/user@example.com",
* evaluation: {
* source: {
* name: "error_count",
* display: "Error Count",
* aggregation: "COUNT",
* },
* comparisonOperator: "GREATER_THAN",
* threshold: {
* value: {
* doubleValue: 100,
* },
* },
* emptyResultState: "OK",
* notification: {
* subscriptions: [{
* userEmail: "user@example.com",
* }],
* notifyOnOk: true,
* },
* },
* schedule: {
* quartzCronSchedule: "0 0/15 * * * ?",
* timezoneId: "America/Los_Angeles",
* pauseStatus: "UNPAUSED",
* },
* });
* ```
*
* ## Import
*
* As of Pulumi v1.5, resources can be imported through configuration.
*
* hcl
*
* import {
*
* id = "id"
*
* to = databricks_alert_v2.this
*
* }
*
* If you are using an older version of Pulumi, import the resource using the `pulumi import` command as follows:
*
* ```sh
* $ pulumi import databricks:index/alertV2:AlertV2 this "id"
* ```
*/
export declare class AlertV2 extends pulumi.CustomResource {
/**
* Get an existing AlertV2 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: string, id: pulumi.Input<pulumi.ID>, state?: AlertV2State, opts?: pulumi.CustomResourceOptions): AlertV2;
/**
* Returns true if the given object is an instance of AlertV2. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is AlertV2;
/**
* (string) - The timestamp indicating when the alert was created
*/
readonly createTime: pulumi.Output<string>;
/**
* Custom description for the alert. support mustache template
*/
readonly customDescription: pulumi.Output<string | undefined>;
/**
* Custom summary for the alert. support mustache template
*/
readonly customSummary: pulumi.Output<string | undefined>;
/**
* The display name of the alert
*/
readonly displayName: pulumi.Output<string>;
/**
* (AlertV2RunAs) - The actual identity that will be used to execute the alert.
* This is an output-only field that shows the resolved run-as identity after applying
* permissions and defaults
*/
readonly effectiveRunAs: pulumi.Output<outputs.AlertV2EffectiveRunAs>;
readonly evaluation: pulumi.Output<outputs.AlertV2Evaluation>;
/**
* (string) - Indicates whether the query is trashed. Possible values are: `ACTIVE`, `DELETED`
*/
readonly lifecycleState: pulumi.Output<string>;
/**
* (string) - The owner's username. This field is set to "Unavailable" if the user has been deleted
*/
readonly ownerUserName: pulumi.Output<string>;
/**
* The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated
*/
readonly parentPath: pulumi.Output<string | undefined>;
/**
* Text of the query to be run
*/
readonly queryText: pulumi.Output<string>;
/**
* Specifies the identity that will be used to run the alert.
* This field allows you to configure alerts to run as a specific user or service principal.
* - For user identity: Set `userName` to the email of an active workspace user. Users can only set this to their own email.
* - For service principal: Set `servicePrincipalName` to the application ID. Requires the `servicePrincipal/user` role.
* If not specified, the alert will run as the request user
*/
readonly runAs: pulumi.Output<outputs.AlertV2RunAs | undefined>;
/**
* The run as username or application ID of service principal.
* On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role.
* Deprecated: Use `runAs` field instead. This field will be removed in a future release
*/
readonly runAsUserName: pulumi.Output<string | undefined>;
readonly schedule: pulumi.Output<outputs.AlertV2Schedule>;
/**
* (string) - The timestamp indicating when the alert was updated
*/
readonly updateTime: pulumi.Output<string>;
/**
* ID of the SQL warehouse attached to the alert
*/
readonly warehouseId: pulumi.Output<string>;
/**
* Create a AlertV2 resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: AlertV2Args, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AlertV2 resources.
*/
export interface AlertV2State {
/**
* (string) - The timestamp indicating when the alert was created
*/
createTime?: pulumi.Input<string>;
/**
* Custom description for the alert. support mustache template
*/
customDescription?: pulumi.Input<string>;
/**
* Custom summary for the alert. support mustache template
*/
customSummary?: pulumi.Input<string>;
/**
* The display name of the alert
*/
displayName?: pulumi.Input<string>;
/**
* (AlertV2RunAs) - The actual identity that will be used to execute the alert.
* This is an output-only field that shows the resolved run-as identity after applying
* permissions and defaults
*/
effectiveRunAs?: pulumi.Input<inputs.AlertV2EffectiveRunAs>;
evaluation?: pulumi.Input<inputs.AlertV2Evaluation>;
/**
* (string) - Indicates whether the query is trashed. Possible values are: `ACTIVE`, `DELETED`
*/
lifecycleState?: pulumi.Input<string>;
/**
* (string) - The owner's username. This field is set to "Unavailable" if the user has been deleted
*/
ownerUserName?: pulumi.Input<string>;
/**
* The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated
*/
parentPath?: pulumi.Input<string>;
/**
* Text of the query to be run
*/
queryText?: pulumi.Input<string>;
/**
* Specifies the identity that will be used to run the alert.
* This field allows you to configure alerts to run as a specific user or service principal.
* - For user identity: Set `userName` to the email of an active workspace user. Users can only set this to their own email.
* - For service principal: Set `servicePrincipalName` to the application ID. Requires the `servicePrincipal/user` role.
* If not specified, the alert will run as the request user
*/
runAs?: pulumi.Input<inputs.AlertV2RunAs>;
/**
* The run as username or application ID of service principal.
* On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role.
* Deprecated: Use `runAs` field instead. This field will be removed in a future release
*/
runAsUserName?: pulumi.Input<string>;
schedule?: pulumi.Input<inputs.AlertV2Schedule>;
/**
* (string) - The timestamp indicating when the alert was updated
*/
updateTime?: pulumi.Input<string>;
/**
* ID of the SQL warehouse attached to the alert
*/
warehouseId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a AlertV2 resource.
*/
export interface AlertV2Args {
/**
* Custom description for the alert. support mustache template
*/
customDescription?: pulumi.Input<string>;
/**
* Custom summary for the alert. support mustache template
*/
customSummary?: pulumi.Input<string>;
/**
* The display name of the alert
*/
displayName: pulumi.Input<string>;
evaluation: pulumi.Input<inputs.AlertV2Evaluation>;
/**
* The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated
*/
parentPath?: pulumi.Input<string>;
/**
* Text of the query to be run
*/
queryText: pulumi.Input<string>;
/**
* Specifies the identity that will be used to run the alert.
* This field allows you to configure alerts to run as a specific user or service principal.
* - For user identity: Set `userName` to the email of an active workspace user. Users can only set this to their own email.
* - For service principal: Set `servicePrincipalName` to the application ID. Requires the `servicePrincipal/user` role.
* If not specified, the alert will run as the request user
*/
runAs?: pulumi.Input<inputs.AlertV2RunAs>;
/**
* The run as username or application ID of service principal.
* On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role.
* Deprecated: Use `runAs` field instead. This field will be removed in a future release
*/
runAsUserName?: pulumi.Input<string>;
schedule: pulumi.Input<inputs.AlertV2Schedule>;
/**
* ID of the SQL warehouse attached to the alert
*/
warehouseId: pulumi.Input<string>;
}