newrelic logo
New Relic v5.12.0, May 30 23

newrelic.getAlertChannel

Explore with Pulumi AI

Use this data source to get information about a specific alert channel in New Relic that already exists.

WARNING: The newrelic.AlertChannel data source is deprecated and will be removed in the next major release.

Example Usage

Coming soon!

Coming soon!

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.GetAlertChannelArgs;
import com.pulumi.newrelic.AlertPolicy;
import com.pulumi.newrelic.AlertPolicyChannel;
import com.pulumi.newrelic.AlertPolicyChannelArgs;
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 fooAlertChannel = NewrelicFunctions.getAlertChannel(GetAlertChannelArgs.builder()
            .name("foo@example.com")
            .build());

        var fooAlertPolicy = new AlertPolicy("fooAlertPolicy");

        var fooAlertPolicyChannel = new AlertPolicyChannel("fooAlertPolicyChannel", AlertPolicyChannelArgs.builder()        
            .policyId(fooAlertPolicy.id())
            .channelId(fooAlertChannel.applyValue(getAlertChannelResult -> getAlertChannelResult.id()))
            .build());

    }
}

Coming soon!

Coming soon!

resources:
  # Resource
  fooAlertPolicy:
    type: newrelic:AlertPolicy
  # Using the data source and resource together
  fooAlertPolicyChannel:
    type: newrelic:AlertPolicyChannel
    properties:
      policyId: ${fooAlertPolicy.id}
      channelId: ${fooAlertChannel.id}
variables:
  fooAlertChannel:
    fn::invoke:
      Function: newrelic:getAlertChannel
      Arguments:
        name: foo@example.com

Using getAlertChannel

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 getAlertChannel(args: GetAlertChannelArgs, opts?: InvokeOptions): Promise<GetAlertChannelResult>
function getAlertChannelOutput(args: GetAlertChannelOutputArgs, opts?: InvokeOptions): Output<GetAlertChannelResult>
def get_alert_channel(account_id: Optional[int] = None,
                      name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetAlertChannelResult
def get_alert_channel_output(account_id: Optional[pulumi.Input[int]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetAlertChannelResult]
func LookupAlertChannel(ctx *Context, args *LookupAlertChannelArgs, opts ...InvokeOption) (*LookupAlertChannelResult, error)
func LookupAlertChannelOutput(ctx *Context, args *LookupAlertChannelOutputArgs, opts ...InvokeOption) LookupAlertChannelResultOutput

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

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

The following arguments are supported:

Name string

The name of the alert channel 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.

Name string

The name of the alert channel 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.

name String

The name of the alert channel 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.

name string

The name of the alert channel 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.

name str

The name of the alert channel 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.

name String

The name of the alert channel 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.

getAlertChannel Result

The following output properties are available:

AccountId int
Config Pulumi.NewRelic.Outputs.GetAlertChannelConfig

Alert channel configuration.

Id string

The provider-assigned unique ID for this managed resource.

Name string
PolicyIds List<int>

A list of policy IDs associated with the alert channel.

Type string

Alert channel type, either: email, opsgenie, pagerduty, slack, victorops, or webhook.

AccountId int
Config GetAlertChannelConfig

Alert channel configuration.

Id string

The provider-assigned unique ID for this managed resource.

Name string
PolicyIds []int

A list of policy IDs associated with the alert channel.

Type string

Alert channel type, either: email, opsgenie, pagerduty, slack, victorops, or webhook.

accountId Integer
config GetAlertChannelConfig

Alert channel configuration.

id String

The provider-assigned unique ID for this managed resource.

name String
policyIds List<Integer>

A list of policy IDs associated with the alert channel.

type String

Alert channel type, either: email, opsgenie, pagerduty, slack, victorops, or webhook.

accountId number
config GetAlertChannelConfig

Alert channel configuration.

id string

The provider-assigned unique ID for this managed resource.

name string
policyIds number[]

A list of policy IDs associated with the alert channel.

type string

Alert channel type, either: email, opsgenie, pagerduty, slack, victorops, or webhook.

account_id int
config GetAlertChannelConfig

Alert channel configuration.

id str

The provider-assigned unique ID for this managed resource.

name str
policy_ids Sequence[int]

A list of policy IDs associated with the alert channel.

type str

Alert channel type, either: email, opsgenie, pagerduty, slack, victorops, or webhook.

accountId Number
config Property Map

Alert channel configuration.

id String

The provider-assigned unique ID for this managed resource.

name String
policyIds List<Number>

A list of policy IDs associated with the alert channel.

type String

Alert channel type, either: email, opsgenie, pagerduty, slack, victorops, or webhook.

Supporting Types

GetAlertChannelConfig

ApiKey string
AuthPassword string
AuthType string
AuthUsername string
BaseUrl string
Channel string
Headers Dictionary<string, string>
IncludeJsonAttachment string
Key string
Payload Dictionary<string, string>
PayloadString string
PayloadType string
Recipients string
Region string
RouteKey string
ServiceKey string
Tags string
Teams string
Url string
UserId string
ApiKey string
AuthPassword string
AuthType string
AuthUsername string
BaseUrl string
Channel string
Headers map[string]string
IncludeJsonAttachment string
Key string
Payload map[string]string
PayloadString string
PayloadType string
Recipients string
Region string
RouteKey string
ServiceKey string
Tags string
Teams string
Url string
UserId string
apiKey String
authPassword String
authType String
authUsername String
baseUrl String
channel String
headers Map<String,String>
includeJsonAttachment String
key String
payload Map<String,String>
payloadString String
payloadType String
recipients String
region String
routeKey String
serviceKey String
tags String
teams String
url String
userId String
apiKey string
authPassword string
authType string
authUsername string
baseUrl string
channel string
headers {[key: string]: string}
includeJsonAttachment string
key string
payload {[key: string]: string}
payloadString string
payloadType string
recipients string
region string
routeKey string
serviceKey string
tags string
teams string
url string
userId string
apiKey String
authPassword String
authType String
authUsername String
baseUrl String
channel String
headers Map<String>
includeJsonAttachment String
key String
payload Map<String>
payloadString String
payloadType String
recipients String
region String
routeKey String
serviceKey String
tags String
teams String
url String
userId String

Package Details

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

This Pulumi package is based on the newrelic Terraform Provider.