@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
149 lines • 5.5 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.NotificationDestination = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to manage [Notification Destinations](https://docs.databricks.com/api/workspace/notificationdestinations). Notification destinations are used to send notifications for query alerts and jobs to destinations outside of Databricks. Only workspace admins can create, update, and delete notification destinations.
*
* ## Example Usage
*
* `Email` notification destination:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ndresource = new databricks.NotificationDestination("ndresource", {
* displayName: "Notification Destination",
* config: {
* email: {
* addresses: ["abc@gmail.com"],
* },
* },
* });
* ```
* `Slack` notification destination:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ndresource = new databricks.NotificationDestination("ndresource", {
* displayName: "Notification Destination",
* config: {
* slack: {
* url: "https://hooks.slack.com/services/...",
* },
* },
* });
* ```
* `PagerDuty` notification destination:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ndresource = new databricks.NotificationDestination("ndresource", {
* displayName: "Notification Destination",
* config: {
* pagerduty: {
* integrationKey: "xxxxxx",
* },
* },
* });
* ```
* `Microsoft Teams` notification destination:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ndresource = new databricks.NotificationDestination("ndresource", {
* displayName: "Notification Destination",
* config: {
* microsoftTeams: {
* url: "https://outlook.office.com/webhook/...",
* },
* },
* });
* ```
* `Generic Webhook` notification destination:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const ndresource = new databricks.NotificationDestination("ndresource", {
* displayName: "Notification Destination",
* config: {
* genericWebhook: {
* url: "https://example.com/webhook",
* username: "username",
* password: "password",
* },
* },
* });
* ```
*
* ## Import
*
* This resource can be imported by notification ID:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/notificationDestination:NotificationDestination this <notification-id>
* ```
*/
class NotificationDestination extends pulumi.CustomResource {
/**
* Get an existing NotificationDestination 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 NotificationDestination(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of NotificationDestination. 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'] === NotificationDestination.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["destinationType"] = state ? state.destinationType : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.displayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["destinationType"] = args ? args.destinationType : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NotificationDestination.__pulumiType, name, resourceInputs, opts);
}
}
exports.NotificationDestination = NotificationDestination;
/** @internal */
NotificationDestination.__pulumiType = 'databricks:index/notificationDestination:NotificationDestination';
//# sourceMappingURL=notificationDestination.js.map
;