newrelic.getNotificationDestination

Explore with Pulumi AI

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var foo = NewRelic.GetNotificationDestination.Invoke(new()
    {
        Id = "1e543419-0c25-456a-9057-fb0eb310e60b",
    });

    // Resource
    var foo_channel = new NewRelic.NotificationChannel("foo-channel", new()
    {
        Type = "WEBHOOK",
        DestinationId = foo.Apply(getNotificationDestinationResult => getNotificationDestinationResult.Id),
        Product = "IINT",
        Properties = new[]
        {
            new NewRelic.Inputs.NotificationChannelPropertyArgs
            {
                Key = "payload",
                Value = @"{
	""name"": ""foo""
}",
                Label = "Payload Template",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		foo, err := newrelic.LookupNotificationDestination(ctx, &newrelic.LookupNotificationDestinationArgs{
			Id: "1e543419-0c25-456a-9057-fb0eb310e60b",
		}, nil)
		if err != nil {
			return err
		}
		_, err = newrelic.NewNotificationChannel(ctx, "foo-channel", &newrelic.NotificationChannelArgs{
			Type:          pulumi.String("WEBHOOK"),
			DestinationId: *pulumi.String(foo.Id),
			Product:       pulumi.String("IINT"),
			Properties: newrelic.NotificationChannelPropertyArray{
				&newrelic.NotificationChannelPropertyArgs{
					Key:   pulumi.String("payload"),
					Value: pulumi.String("{\n	\"name\": \"foo\"\n}"),
					Label: pulumi.String("Payload Template"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.NewrelicFunctions;
import com.pulumi.newrelic.inputs.GetNotificationDestinationArgs;
import com.pulumi.newrelic.NotificationChannel;
import com.pulumi.newrelic.NotificationChannelArgs;
import com.pulumi.newrelic.inputs.NotificationChannelPropertyArgs;
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) {
        final var foo = NewrelicFunctions.getNotificationDestination(GetNotificationDestinationArgs.builder()
            .id("1e543419-0c25-456a-9057-fb0eb310e60b")
            .build());

        var foo_channel = new NotificationChannel("foo-channel", NotificationChannelArgs.builder()        
            .type("WEBHOOK")
            .destinationId(foo.applyValue(getNotificationDestinationResult -> getNotificationDestinationResult.id()))
            .product("IINT")
            .properties(NotificationChannelPropertyArgs.builder()
                .key("payload")
                .value("""
{
	"name": "foo"
}                """)
                .label("Payload Template")
                .build())
            .build());

    }
}
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.get_notification_destination(id="1e543419-0c25-456a-9057-fb0eb310e60b")
# Resource
foo_channel = newrelic.NotificationChannel("foo-channel",
    type="WEBHOOK",
    destination_id=foo.id,
    product="IINT",
    properties=[newrelic.NotificationChannelPropertyArgs(
        key="payload",
        value="""{
	"name": "foo"
}""",
        label="Payload Template",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const foo = newrelic.getNotificationDestination({
    id: "1e543419-0c25-456a-9057-fb0eb310e60b",
});
// Resource
const foo_channel = new newrelic.NotificationChannel("foo-channel", {
    type: "WEBHOOK",
    destinationId: foo.then(foo => foo.id),
    product: "IINT",
    properties: [{
        key: "payload",
        value: `{
	"name": "foo"
}`,
        label: "Payload Template",
    }],
});
resources:
  # Resource
  foo-channel:
    type: newrelic:NotificationChannel
    properties:
      type: WEBHOOK
      destinationId: ${foo.id}
      product: IINT
      properties:
        - key: payload
          value: |-
            {
            	"name": "foo"
            }            
          label: Payload Template
variables:
  foo:
    fn::invoke:
      Function: newrelic:getNotificationDestination
      Arguments:
        id: 1e543419-0c25-456a-9057-fb0eb310e60b

Using getNotificationDestination

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 getNotificationDestination(args: GetNotificationDestinationArgs, opts?: InvokeOptions): Promise<GetNotificationDestinationResult>
function getNotificationDestinationOutput(args: GetNotificationDestinationOutputArgs, opts?: InvokeOptions): Output<GetNotificationDestinationResult>
def get_notification_destination(account_id: Optional[int] = None,
                                 id: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetNotificationDestinationResult
def get_notification_destination_output(account_id: Optional[pulumi.Input[int]] = None,
                                 id: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetNotificationDestinationResult]
func LookupNotificationDestination(ctx *Context, args *LookupNotificationDestinationArgs, opts ...InvokeOption) (*LookupNotificationDestinationResult, error)
func LookupNotificationDestinationOutput(ctx *Context, args *LookupNotificationDestinationOutputArgs, opts ...InvokeOption) LookupNotificationDestinationResultOutput

> Note: This function is named LookupNotificationDestination in the Go SDK.

public static class GetNotificationDestination 
{
    public static Task<GetNotificationDestinationResult> InvokeAsync(GetNotificationDestinationArgs args, InvokeOptions? opts = null)
    public static Output<GetNotificationDestinationResult> Invoke(GetNotificationDestinationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNotificationDestinationResult> getNotificationDestination(GetNotificationDestinationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: newrelic:index/getNotificationDestination:getNotificationDestination
  arguments:
    # arguments dictionary

The following arguments are supported:

Id string

The id of the notification destination in New Relic.

AccountId int

The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

Id string

The id of the notification destination in New Relic.

AccountId int

The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

id String

The id of the notification destination in New Relic.

accountId Integer

The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

id string

The id of the notification destination in New Relic.

accountId number

The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

id str

The id of the notification destination in New Relic.

account_id int

The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

id String

The id of the notification destination in New Relic.

accountId Number

The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

getNotificationDestination Result

The following output properties are available:

AccountId int
Active bool

An indication whether the notification destination is active or not.

Id string
Name string

The name of the notification destination.

Properties List<Pulumi.NewRelic.Outputs.GetNotificationDestinationProperty>

A nested block that describes a notification destination property.

Status string

The status of the notification destination.

Type string

The notification destination type, either: EMAIL, SERVICE_NOW, WEBHOOK, JIRA, MOBILE_PUSH, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION or PAGERDUTY_SERVICE_INTEGRATION, SLACK and SLACK_COLLABORATION.

AccountId int
Active bool

An indication whether the notification destination is active or not.

Id string
Name string

The name of the notification destination.

Properties []GetNotificationDestinationProperty

A nested block that describes a notification destination property.

Status string

The status of the notification destination.

Type string

The notification destination type, either: EMAIL, SERVICE_NOW, WEBHOOK, JIRA, MOBILE_PUSH, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION or PAGERDUTY_SERVICE_INTEGRATION, SLACK and SLACK_COLLABORATION.

accountId Integer
active Boolean

An indication whether the notification destination is active or not.

id String
name String

The name of the notification destination.

properties List<GetNotificationDestinationProperty>

A nested block that describes a notification destination property.

status String

The status of the notification destination.

type String

The notification destination type, either: EMAIL, SERVICE_NOW, WEBHOOK, JIRA, MOBILE_PUSH, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION or PAGERDUTY_SERVICE_INTEGRATION, SLACK and SLACK_COLLABORATION.

accountId number
active boolean

An indication whether the notification destination is active or not.

id string
name string

The name of the notification destination.

properties GetNotificationDestinationProperty[]

A nested block that describes a notification destination property.

status string

The status of the notification destination.

type string

The notification destination type, either: EMAIL, SERVICE_NOW, WEBHOOK, JIRA, MOBILE_PUSH, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION or PAGERDUTY_SERVICE_INTEGRATION, SLACK and SLACK_COLLABORATION.

account_id int
active bool

An indication whether the notification destination is active or not.

id str
name str

The name of the notification destination.

properties Sequence[GetNotificationDestinationProperty]

A nested block that describes a notification destination property.

status str

The status of the notification destination.

type str

The notification destination type, either: EMAIL, SERVICE_NOW, WEBHOOK, JIRA, MOBILE_PUSH, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION or PAGERDUTY_SERVICE_INTEGRATION, SLACK and SLACK_COLLABORATION.

accountId Number
active Boolean

An indication whether the notification destination is active or not.

id String
name String

The name of the notification destination.

properties List<Property Map>

A nested block that describes a notification destination property.

status String

The status of the notification destination.

type String

The notification destination type, either: EMAIL, SERVICE_NOW, WEBHOOK, JIRA, MOBILE_PUSH, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION or PAGERDUTY_SERVICE_INTEGRATION, SLACK and SLACK_COLLABORATION.

Supporting Types

GetNotificationDestinationProperty

Key string
Value string
DisplayValue string
Label string
Key string
Value string
DisplayValue string
Label string
key String
value String
displayValue String
label String
key string
value string
displayValue string
label string
key String
value String
displayValue String
label String

Package Details

Repository
New Relic pulumi/pulumi-newrelic
License
Apache-2.0
Notes

This Pulumi package is based on the newrelic Terraform Provider.