1. Packages
  2. Databricks
  3. API Docs
  4. getNotificationDestinations
Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi

databricks.getNotificationDestinations

Explore with Pulumi AI

databricks logo
Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi

    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:

    DisplayNameContains string
    A case-insensitive substring to filter Notification Destinations by their display name.
    NotificationDestinations List<GetNotificationDestinationsNotificationDestination>
    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.
    DisplayNameContains string
    A case-insensitive substring to filter Notification Destinations by their display name.
    NotificationDestinations []GetNotificationDestinationsNotificationDestination
    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.
    displayNameContains String
    A case-insensitive substring to filter Notification Destinations by their display name.
    notificationDestinations List<GetNotificationDestinationsNotificationDestination>
    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.
    displayNameContains string
    A case-insensitive substring to filter Notification Destinations by their display name.
    notificationDestinations GetNotificationDestinationsNotificationDestination[]
    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_contains str
    A case-insensitive substring to filter Notification Destinations by their display name.
    notification_destinations Sequence[GetNotificationDestinationsNotificationDestination]
    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.
    displayNameContains String
    A case-insensitive substring to filter Notification Destinations by their display name.
    notificationDestinations 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.
    DisplayNameContains string
    NotificationDestinations List<GetNotificationDestinationsNotificationDestination>
    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.
    DisplayNameContains string
    NotificationDestinations []GetNotificationDestinationsNotificationDestination
    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.
    displayNameContains String
    notificationDestinations List<GetNotificationDestinationsNotificationDestination>
    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.
    displayNameContains string
    notificationDestinations GetNotificationDestinationsNotificationDestination[]
    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_contains str
    notification_destinations Sequence[GetNotificationDestinationsNotificationDestination]
    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.
    displayNameContains String
    notificationDestinations List<Property Map>
    A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
    type String

    Supporting Types

    GetNotificationDestinationsNotificationDestination

    DestinationType string
    The type of the notification destination. Possible values are EMAIL, MICROSOFT_TEAMS, PAGERDUTY, SLACK, or WEBHOOK.
    DisplayName string
    The display name of the Notification Destination.
    Id string
    The unique ID of the Notification Destination.
    DestinationType string
    The type of the notification destination. Possible values are EMAIL, MICROSOFT_TEAMS, PAGERDUTY, SLACK, or WEBHOOK.
    DisplayName string
    The display name of the Notification Destination.
    Id string
    The unique ID of the Notification Destination.
    destinationType String
    The type of the notification destination. Possible values are EMAIL, MICROSOFT_TEAMS, PAGERDUTY, SLACK, or WEBHOOK.
    displayName String
    The display name of the Notification Destination.
    id String
    The unique ID of the Notification Destination.
    destinationType string
    The type of the notification destination. Possible values are EMAIL, MICROSOFT_TEAMS, PAGERDUTY, SLACK, or WEBHOOK.
    displayName 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, or WEBHOOK.
    display_name str
    The display name of the Notification Destination.
    id str
    The unique ID of the Notification Destination.
    destinationType String
    The type of the notification destination. Possible values are EMAIL, MICROSOFT_TEAMS, PAGERDUTY, SLACK, or WEBHOOK.
    displayName 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.
    databricks logo
    Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi