New Relic v5.12.0, May 30 23
New Relic v5.12.0, May 30 23
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 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 variableNEW_RELIC_ACCOUNT_ID
.
getNotificationDestination Result
The following output properties are available:
- Account
Id 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.
New Relic. Outputs. Get Notification Destination Property> 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
orPAGERDUTY_SERVICE_INTEGRATION
,SLACK
andSLACK_COLLABORATION
.
- Account
Id int - Active bool
An indication whether the notification destination is active or not.
- Id string
- Name string
The name of the notification destination.
- Properties
[]Get
Notification Destination Property 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
orPAGERDUTY_SERVICE_INTEGRATION
,SLACK
andSLACK_COLLABORATION
.
- account
Id 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<Get
Notification Destination Property> 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
orPAGERDUTY_SERVICE_INTEGRATION
,SLACK
andSLACK_COLLABORATION
.
- account
Id number - active boolean
An indication whether the notification destination is active or not.
- id string
- name string
The name of the notification destination.
- properties
Get
Notification Destination Property[] 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
orPAGERDUTY_SERVICE_INTEGRATION
,SLACK
andSLACK_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[Get
Notification Destination Property] 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
orPAGERDUTY_SERVICE_INTEGRATION
,SLACK
andSLACK_COLLABORATION
.
- account
Id 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
orPAGERDUTY_SERVICE_INTEGRATION
,SLACK
andSLACK_COLLABORATION
.
Supporting Types
GetNotificationDestinationProperty
- Key string
- Value string
- Display
Value string - Label string
- Key string
- Value string
- Display
Value string - Label string
- key String
- value String
- display
Value String - label String
- key string
- value string
- display
Value string - label string
- key str
- value str
- display_
value str - label str
- key String
- value String
- display
Value 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.