Show / Hide Table of Contents

Class AlertPolicyChannel

Use this resource to map alert policies to alert channels in New Relic.

Example Usage

using Pulumi;
using NewRelic = Pulumi.NewRelic;

class MyStack : Stack
{
public MyStack()
{
    var examplePolicy = Output.Create(NewRelic.GetAlertPolicy.InvokeAsync(new NewRelic.GetAlertPolicyArgs
    {
        Name = "my-alert-policy",
    }));
    // Creates an email alert channel.
    var emailChannel = new NewRelic.AlertChannel("emailChannel", new NewRelic.AlertChannelArgs
    {
        Type = "email",
        Config = new NewRelic.Inputs.AlertChannelConfigArgs
        {
            Recipients = "foo@example.com",
            IncludeJsonAttachment = "1",
        },
    });
    // Creates a Slack alert channel.
    var slackChannel = new NewRelic.AlertChannel("slackChannel", new NewRelic.AlertChannelArgs
    {
        Type = "slack",
        Config = new NewRelic.Inputs.AlertChannelConfigArgs
        {
            Channel = "#example-channel",
            Url = "http://example-org.slack.com",
        },
    });
    // Applies the created channels above to the alert policy
    // referenced at the top of the config.
    var foo = new NewRelic.AlertPolicyChannel("foo", new NewRelic.AlertPolicyChannelArgs
    {
        PolicyId = newrelic_alert_policy.Example_policy.Id,
        ChannelIds = 
        {
            emailChannel.Id,
            slackChannel.Id,
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
AlertPolicyChannel
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.NewRelic
Assembly: Pulumi.NewRelic.dll
Syntax
public class AlertPolicyChannel : CustomResource

Constructors

View Source

AlertPolicyChannel(String, AlertPolicyChannelArgs, CustomResourceOptions)

Create a AlertPolicyChannel resource with the given unique name, arguments, and options.

Declaration
public AlertPolicyChannel(string name, AlertPolicyChannelArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

AlertPolicyChannelArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ChannelId

Deprecated. The ID of the channel. Please use the channel_ids argument instead.

Declaration
public Output<int?> ChannelId { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

ChannelIds

Array of channel IDs to apply to the specified policy. We recommended sorting channel IDs in ascending order to avoid drift your Terraform state.

Declaration
public Output<ImmutableArray<int>> ChannelIds { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.Int32>>
View Source

PolicyId

The ID of the policy.

Declaration
public Output<int> PolicyId { get; }
Property Value
Type Description
Output<System.Int32>

Methods

View Source

Get(String, Input<String>, AlertPolicyChannelState, CustomResourceOptions)

Get an existing AlertPolicyChannel resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static AlertPolicyChannel Get(string name, Input<string> id, AlertPolicyChannelState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

AlertPolicyChannelState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
AlertPolicyChannel
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.