Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi
databricks.getNotificationDestinations
Explore with Pulumi AI
This data source allows you to retrieve information about Notification Destinations. Notification Destinations are used to send notifications for query alerts and jobs to external systems such as email, Slack, Microsoft Teams, PagerDuty, or generic webhooks.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const email = new databricks.NotificationDestination("email", {
displayName: "Email Destination",
config: {
email: {
addresses: ["abc@gmail.com"],
},
},
});
const slack = new databricks.NotificationDestination("slack", {
displayName: "Slack Destination",
config: {
slack: {
url: "https://hooks.slack.com/services/...",
},
},
});
// Lists all notification desitnations
const this = databricks.getNotificationDestinations({});
// List destinations of specific type and name
const filteredNotification = databricks.getNotificationDestinations({
displayNameContains: "Destination",
type: "EMAIL",
});
import pulumi
import pulumi_databricks as databricks
email = databricks.NotificationDestination("email",
display_name="Email Destination",
config={
"email": {
"addresses": ["abc@gmail.com"],
},
})
slack = databricks.NotificationDestination("slack",
display_name="Slack Destination",
config={
"slack": {
"url": "https://hooks.slack.com/services/...",
},
})
# Lists all notification desitnations
this = databricks.get_notification_destinations()
# List destinations of specific type and name
filtered_notification = databricks.get_notification_destinations(display_name_contains="Destination",
type="EMAIL")
package main
import (
"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := databricks.NewNotificationDestination(ctx, "email", &databricks.NotificationDestinationArgs{
DisplayName: pulumi.String("Email Destination"),
Config: &databricks.NotificationDestinationConfigArgs{
Email: &databricks.NotificationDestinationConfigEmailArgs{
Addresses: pulumi.StringArray{
pulumi.String("abc@gmail.com"),
},
},
},
})
if err != nil {
return err
}
_, err = databricks.NewNotificationDestination(ctx, "slack", &databricks.NotificationDestinationArgs{
DisplayName: pulumi.String("Slack Destination"),
Config: &databricks.NotificationDestinationConfigArgs{
Slack: &databricks.NotificationDestinationConfigSlackArgs{
Url: pulumi.String("https://hooks.slack.com/services/..."),
},
},
})
if err != nil {
return err
}
// Lists all notification desitnations
_, err = databricks.GetNotificationDestinations(ctx, &databricks.GetNotificationDestinationsArgs{}, nil)
if err != nil {
return err
}
// List destinations of specific type and name
_, err = databricks.GetNotificationDestinations(ctx, &databricks.GetNotificationDestinationsArgs{
DisplayNameContains: pulumi.StringRef("Destination"),
Type: pulumi.StringRef("EMAIL"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var email = new Databricks.NotificationDestination("email", new()
{
DisplayName = "Email Destination",
Config = new Databricks.Inputs.NotificationDestinationConfigArgs
{
Email = new Databricks.Inputs.NotificationDestinationConfigEmailArgs
{
Addresses = new[]
{
"abc@gmail.com",
},
},
},
});
var slack = new Databricks.NotificationDestination("slack", new()
{
DisplayName = "Slack Destination",
Config = new Databricks.Inputs.NotificationDestinationConfigArgs
{
Slack = new Databricks.Inputs.NotificationDestinationConfigSlackArgs
{
Url = "https://hooks.slack.com/services/...",
},
},
});
// Lists all notification desitnations
var @this = Databricks.GetNotificationDestinations.Invoke();
// List destinations of specific type and name
var filteredNotification = Databricks.GetNotificationDestinations.Invoke(new()
{
DisplayNameContains = "Destination",
Type = "EMAIL",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.NotificationDestination;
import com.pulumi.databricks.NotificationDestinationArgs;
import com.pulumi.databricks.inputs.NotificationDestinationConfigArgs;
import com.pulumi.databricks.inputs.NotificationDestinationConfigEmailArgs;
import com.pulumi.databricks.inputs.NotificationDestinationConfigSlackArgs;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetNotificationDestinationsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var email = new NotificationDestination("email", NotificationDestinationArgs.builder()
.displayName("Email Destination")
.config(NotificationDestinationConfigArgs.builder()
.email(NotificationDestinationConfigEmailArgs.builder()
.addresses("abc@gmail.com")
.build())
.build())
.build());
var slack = new NotificationDestination("slack", NotificationDestinationArgs.builder()
.displayName("Slack Destination")
.config(NotificationDestinationConfigArgs.builder()
.slack(NotificationDestinationConfigSlackArgs.builder()
.url("https://hooks.slack.com/services/...")
.build())
.build())
.build());
// Lists all notification desitnations
final var this = DatabricksFunctions.getNotificationDestinations();
// List destinations of specific type and name
final var filteredNotification = DatabricksFunctions.getNotificationDestinations(GetNotificationDestinationsArgs.builder()
.displayNameContains("Destination")
.type("EMAIL")
.build());
}
}
resources:
email:
type: databricks:NotificationDestination
properties:
displayName: Email Destination
config:
email:
addresses:
- abc@gmail.com
slack:
type: databricks:NotificationDestination
properties:
displayName: Slack Destination
config:
slack:
url: https://hooks.slack.com/services/...
variables:
# Lists all notification desitnations
this:
fn::invoke:
Function: databricks:getNotificationDestinations
Arguments: {}
# List destinations of specific type and name
filteredNotification:
fn::invoke:
Function: databricks:getNotificationDestinations
Arguments:
displayNameContains: Destination
type: EMAIL
Using getNotificationDestinations
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNotificationDestinations(args: GetNotificationDestinationsArgs, opts?: InvokeOptions): Promise<GetNotificationDestinationsResult>
function getNotificationDestinationsOutput(args: GetNotificationDestinationsOutputArgs, opts?: InvokeOptions): Output<GetNotificationDestinationsResult>
def get_notification_destinations(display_name_contains: Optional[str] = None,
notification_destinations: Optional[Sequence[GetNotificationDestinationsNotificationDestination]] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNotificationDestinationsResult
def get_notification_destinations_output(display_name_contains: Optional[pulumi.Input[str]] = None,
notification_destinations: Optional[pulumi.Input[Sequence[pulumi.Input[GetNotificationDestinationsNotificationDestinationArgs]]]] = None,
type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNotificationDestinationsResult]
func GetNotificationDestinations(ctx *Context, args *GetNotificationDestinationsArgs, opts ...InvokeOption) (*GetNotificationDestinationsResult, error)
func GetNotificationDestinationsOutput(ctx *Context, args *GetNotificationDestinationsOutputArgs, opts ...InvokeOption) GetNotificationDestinationsResultOutput
> Note: This function is named GetNotificationDestinations
in the Go SDK.
public static class GetNotificationDestinations
{
public static Task<GetNotificationDestinationsResult> InvokeAsync(GetNotificationDestinationsArgs args, InvokeOptions? opts = null)
public static Output<GetNotificationDestinationsResult> Invoke(GetNotificationDestinationsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNotificationDestinationsResult> getNotificationDestinations(GetNotificationDestinationsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getNotificationDestinations:getNotificationDestinations
arguments:
# arguments dictionary
The following arguments are supported:
- Display
Name stringContains - A case-insensitive substring to filter Notification Destinations by their display name.
- Notification
Destinations List<GetNotification Destinations Notification Destination> - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- Type string
- The type of the Notification Destination to filter by. Valid values are:
EMAIL
- Filters Notification Destinations of type Email.MICROSOFT_TEAMS
- Filters Notification Destinations of type Microsoft Teams.PAGERDUTY
- Filters Notification Destinations of type PagerDuty.SLACK
- Filters Notification Destinations of type Slack.WEBHOOK
- Filters Notification Destinations of type Webhook.
- Display
Name stringContains - A case-insensitive substring to filter Notification Destinations by their display name.
- Notification
Destinations []GetNotification Destinations Notification Destination - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- Type string
- The type of the Notification Destination to filter by. Valid values are:
EMAIL
- Filters Notification Destinations of type Email.MICROSOFT_TEAMS
- Filters Notification Destinations of type Microsoft Teams.PAGERDUTY
- Filters Notification Destinations of type PagerDuty.SLACK
- Filters Notification Destinations of type Slack.WEBHOOK
- Filters Notification Destinations of type Webhook.
- display
Name StringContains - A case-insensitive substring to filter Notification Destinations by their display name.
- notification
Destinations List<GetNotification Destinations Notification Destination> - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type String
- The type of the Notification Destination to filter by. Valid values are:
EMAIL
- Filters Notification Destinations of type Email.MICROSOFT_TEAMS
- Filters Notification Destinations of type Microsoft Teams.PAGERDUTY
- Filters Notification Destinations of type PagerDuty.SLACK
- Filters Notification Destinations of type Slack.WEBHOOK
- Filters Notification Destinations of type Webhook.
- display
Name stringContains - A case-insensitive substring to filter Notification Destinations by their display name.
- notification
Destinations GetNotification Destinations Notification Destination[] - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type string
- The type of the Notification Destination to filter by. Valid values are:
EMAIL
- Filters Notification Destinations of type Email.MICROSOFT_TEAMS
- Filters Notification Destinations of type Microsoft Teams.PAGERDUTY
- Filters Notification Destinations of type PagerDuty.SLACK
- Filters Notification Destinations of type Slack.WEBHOOK
- Filters Notification Destinations of type Webhook.
- display_
name_ strcontains - A case-insensitive substring to filter Notification Destinations by their display name.
- notification_
destinations Sequence[GetNotification Destinations Notification Destination] - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type str
- The type of the Notification Destination to filter by. Valid values are:
EMAIL
- Filters Notification Destinations of type Email.MICROSOFT_TEAMS
- Filters Notification Destinations of type Microsoft Teams.PAGERDUTY
- Filters Notification Destinations of type PagerDuty.SLACK
- Filters Notification Destinations of type Slack.WEBHOOK
- Filters Notification Destinations of type Webhook.
- display
Name StringContains - A case-insensitive substring to filter Notification Destinations by their display name.
- notification
Destinations List<Property Map> - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type String
- The type of the Notification Destination to filter by. Valid values are:
EMAIL
- Filters Notification Destinations of type Email.MICROSOFT_TEAMS
- Filters Notification Destinations of type Microsoft Teams.PAGERDUTY
- Filters Notification Destinations of type PagerDuty.SLACK
- Filters Notification Destinations of type Slack.WEBHOOK
- Filters Notification Destinations of type Webhook.
getNotificationDestinations Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Display
Name stringContains - Notification
Destinations List<GetNotification Destinations Notification Destination> - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- Type string
- Id string
- The provider-assigned unique ID for this managed resource.
- Display
Name stringContains - Notification
Destinations []GetNotification Destinations Notification Destination - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- Type string
- id String
- The provider-assigned unique ID for this managed resource.
- display
Name StringContains - notification
Destinations List<GetNotification Destinations Notification Destination> - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type String
- id string
- The provider-assigned unique ID for this managed resource.
- display
Name stringContains - notification
Destinations GetNotification Destinations Notification Destination[] - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type string
- id str
- The provider-assigned unique ID for this managed resource.
- display_
name_ strcontains - notification_
destinations Sequence[GetNotification Destinations Notification Destination] - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type str
- id String
- The provider-assigned unique ID for this managed resource.
- display
Name StringContains - notification
Destinations List<Property Map> - A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
- type String
Supporting Types
GetNotificationDestinationsNotificationDestination
- Destination
Type string - The type of the notification destination. Possible values are
EMAIL
,MICROSOFT_TEAMS
,PAGERDUTY
,SLACK
, orWEBHOOK
. - Display
Name string - The display name of the Notification Destination.
- Id string
- The unique ID of the Notification Destination.
- Destination
Type string - The type of the notification destination. Possible values are
EMAIL
,MICROSOFT_TEAMS
,PAGERDUTY
,SLACK
, orWEBHOOK
. - Display
Name string - The display name of the Notification Destination.
- Id string
- The unique ID of the Notification Destination.
- destination
Type String - The type of the notification destination. Possible values are
EMAIL
,MICROSOFT_TEAMS
,PAGERDUTY
,SLACK
, orWEBHOOK
. - display
Name String - The display name of the Notification Destination.
- id String
- The unique ID of the Notification Destination.
- destination
Type string - The type of the notification destination. Possible values are
EMAIL
,MICROSOFT_TEAMS
,PAGERDUTY
,SLACK
, orWEBHOOK
. - display
Name string - The display name of the Notification Destination.
- id string
- The unique ID of the Notification Destination.
- destination_
type str - The type of the notification destination. Possible values are
EMAIL
,MICROSOFT_TEAMS
,PAGERDUTY
,SLACK
, orWEBHOOK
. - display_
name str - The display name of the Notification Destination.
- id str
- The unique ID of the Notification Destination.
- destination
Type String - The type of the notification destination. Possible values are
EMAIL
,MICROSOFT_TEAMS
,PAGERDUTY
,SLACK
, orWEBHOOK
. - display
Name String - The display name of the Notification Destination.
- id String
- The unique ID of the Notification Destination.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.