newrelic.AlertChannel
Explore with Pulumi AI
Use this resource to create and manage New Relic alert channels.
WARNING: The
newrelic.AlertChannel
resource is deprecated and will be removed in a future major release. As an alternative, you can set up channels using a combination of the newer resourcesnewrelic.NotificationDestination
andnewrelic.NotificationChannel
. We strongly recommend migrating to these new resources at the earliest. Please refer to this example for a detailed illustration on setting up channels with these resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "foo",
type: "email",
config: {
recipients: "foo@example.com",
includeJsonAttachment: "true",
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="foo",
type="email",
config={
"recipients": "foo@example.com",
"include_json_attachment": "true",
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("foo"),
Type: pulumi.String("email"),
Config: &newrelic.AlertChannelConfigArgs{
Recipients: pulumi.String("foo@example.com"),
IncludeJsonAttachment: pulumi.String("true"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "foo",
Type = "email",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
Recipients = "foo@example.com",
IncludeJsonAttachment = "true",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("foo")
.type("email")
.config(AlertChannelConfigArgs.builder()
.recipients("foo@example.com")
.includeJsonAttachment("true")
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: foo
type: email
config:
recipients: foo@example.com
includeJsonAttachment: 'true'
Additional Examples
Slack
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "slack-example",
type: "slack",
config: {
url: "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
channel: "example-alerts-channel",
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="slack-example",
type="slack",
config={
"url": "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
"channel": "example-alerts-channel",
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("slack-example"),
Type: pulumi.String("slack"),
Config: &newrelic.AlertChannelConfigArgs{
Url: pulumi.String("https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX"),
Channel: pulumi.String("example-alerts-channel"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "slack-example",
Type = "slack",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
Url = "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
Channel = "example-alerts-channel",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("slack-example")
.type("slack")
.config(AlertChannelConfigArgs.builder()
.url("https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX")
.channel("example-alerts-channel")
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: slack-example
type: slack
config:
url: https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX
channel: example-alerts-channel
NOTE: For instructions on setting up Webhooks with Slack, please visit the article linked under the argument
slack
in the aforementioned configuration, or this article in New Relic’s docs for additional details on setting up theNew Relic Alerts
Slack application, and subsequently using the generated Webhook URL.
OpsGenie
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "opsgenie-example",
type: "opsgenie",
config: {
apiKey: "abc123",
teams: "team1, team2",
tags: "tag1, tag2",
recipients: "user1@domain.com, user2@domain.com",
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="opsgenie-example",
type="opsgenie",
config={
"api_key": "abc123",
"teams": "team1, team2",
"tags": "tag1, tag2",
"recipients": "user1@domain.com, user2@domain.com",
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("opsgenie-example"),
Type: pulumi.String("opsgenie"),
Config: &newrelic.AlertChannelConfigArgs{
ApiKey: pulumi.String("abc123"),
Teams: pulumi.String("team1, team2"),
Tags: pulumi.String("tag1, tag2"),
Recipients: pulumi.String("user1@domain.com, user2@domain.com"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "opsgenie-example",
Type = "opsgenie",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
ApiKey = "abc123",
Teams = "team1, team2",
Tags = "tag1, tag2",
Recipients = "user1@domain.com, user2@domain.com",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("opsgenie-example")
.type("opsgenie")
.config(AlertChannelConfigArgs.builder()
.apiKey("abc123")
.teams("team1, team2")
.tags("tag1, tag2")
.recipients("user1@domain.com, user2@domain.com")
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: opsgenie-example
type: opsgenie
config:
apiKey: abc123
teams: team1, team2
tags: tag1, tag2
recipients: user1@domain.com, user2@domain.com
PagerDuty
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "pagerduty-example",
type: "pagerduty",
config: {
serviceKey: "abc123",
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="pagerduty-example",
type="pagerduty",
config={
"service_key": "abc123",
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("pagerduty-example"),
Type: pulumi.String("pagerduty"),
Config: &newrelic.AlertChannelConfigArgs{
ServiceKey: pulumi.String("abc123"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "pagerduty-example",
Type = "pagerduty",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
ServiceKey = "abc123",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("pagerduty-example")
.type("pagerduty")
.config(AlertChannelConfigArgs.builder()
.serviceKey("abc123")
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: pagerduty-example
type: pagerduty
config:
serviceKey: abc123
VictorOps
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "victorops-example",
type: "victorops",
config: {
key: "abc123",
routeKey: "/example",
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="victorops-example",
type="victorops",
config={
"key": "abc123",
"route_key": "/example",
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("victorops-example"),
Type: pulumi.String("victorops"),
Config: &newrelic.AlertChannelConfigArgs{
Key: pulumi.String("abc123"),
RouteKey: pulumi.String("/example"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "victorops-example",
Type = "victorops",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
Key = "abc123",
RouteKey = "/example",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("victorops-example")
.type("victorops")
.config(AlertChannelConfigArgs.builder()
.key("abc123")
.routeKey("/example")
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: victorops-example
type: victorops
config:
key: abc123
routeKey: /example
Webhook
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "webhook-example",
type: "webhook",
config: {
baseUrl: "http://www.test.com",
payloadType: "application/json",
payload: {
condition_name: "$CONDITION_NAME",
policy_name: "$POLICY_NAME",
},
headers: {
header1: value1,
header2: value2,
},
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="webhook-example",
type="webhook",
config={
"base_url": "http://www.test.com",
"payload_type": "application/json",
"payload": {
"condition_name": "$CONDITION_NAME",
"policy_name": "$POLICY_NAME",
},
"headers": {
"header1": value1,
"header2": value2,
},
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("webhook-example"),
Type: pulumi.String("webhook"),
Config: &newrelic.AlertChannelConfigArgs{
BaseUrl: pulumi.String("http://www.test.com"),
PayloadType: pulumi.String("application/json"),
Payload: pulumi.StringMap{
"condition_name": pulumi.String("$CONDITION_NAME"),
"policy_name": pulumi.String("$POLICY_NAME"),
},
Headers: pulumi.StringMap{
"header1": pulumi.Any(value1),
"header2": pulumi.Any(value2),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "webhook-example",
Type = "webhook",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
BaseUrl = "http://www.test.com",
PayloadType = "application/json",
Payload =
{
{ "condition_name", "$CONDITION_NAME" },
{ "policy_name", "$POLICY_NAME" },
},
Headers =
{
{ "header1", value1 },
{ "header2", value2 },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("webhook-example")
.type("webhook")
.config(AlertChannelConfigArgs.builder()
.baseUrl("http://www.test.com")
.payloadType("application/json")
.payload(Map.ofEntries(
Map.entry("condition_name", "$CONDITION_NAME"),
Map.entry("policy_name", "$POLICY_NAME")
))
.headers(Map.ofEntries(
Map.entry("header1", value1),
Map.entry("header2", value2)
))
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: webhook-example
type: webhook
config:
baseUrl: http://www.test.com
payloadType: application/json
payload:
condition_name: $CONDITION_NAME
policy_name: $POLICY_NAME
headers:
header1: ${value1}
header2: ${value2}
Webhook with complex payload
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertChannel("foo", {
name: "webhook-example",
type: "webhook",
config: {
baseUrl: "http://www.test.com",
payloadType: "application/json",
payloadString: `{
"my_custom_values": {
"condition_name": "CONDITION_NAME",
"policy_name": "POLICY_NAME"
}
}
`,
},
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertChannel("foo",
name="webhook-example",
type="webhook",
config={
"base_url": "http://www.test.com",
"payload_type": "application/json",
"payload_string": """{
"my_custom_values": {
"condition_name": "$CONDITION_NAME",
"policy_name": "$POLICY_NAME"
}
}
""",
})
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 {
_, err := newrelic.NewAlertChannel(ctx, "foo", &newrelic.AlertChannelArgs{
Name: pulumi.String("webhook-example"),
Type: pulumi.String("webhook"),
Config: &newrelic.AlertChannelConfigArgs{
BaseUrl: pulumi.String("http://www.test.com"),
PayloadType: pulumi.String("application/json"),
PayloadString: pulumi.String(`{
"my_custom_values": {
"condition_name": "$CONDITION_NAME",
"policy_name": "$POLICY_NAME"
}
}
`),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.AlertChannel("foo", new()
{
Name = "webhook-example",
Type = "webhook",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
BaseUrl = "http://www.test.com",
PayloadType = "application/json",
PayloadString = @"{
""my_custom_values"": {
""condition_name"": ""$CONDITION_NAME"",
""policy_name"": ""$POLICY_NAME""
}
}
",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.AlertChannel;
import com.pulumi.newrelic.AlertChannelArgs;
import com.pulumi.newrelic.inputs.AlertChannelConfigArgs;
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 foo = new AlertChannel("foo", AlertChannelArgs.builder()
.name("webhook-example")
.type("webhook")
.config(AlertChannelConfigArgs.builder()
.baseUrl("http://www.test.com")
.payloadType("application/json")
.payloadString("""
{
"my_custom_values": {
"condition_name": "$CONDITION_NAME",
"policy_name": "$POLICY_NAME"
}
}
""")
.build())
.build());
}
}
resources:
foo:
type: newrelic:AlertChannel
properties:
name: webhook-example
type: webhook
config:
baseUrl: http://www.test.com
payloadType: application/json
payloadString: |
{
"my_custom_values": {
"condition_name": "$CONDITION_NAME",
"policy_name": "$POLICY_NAME"
}
}
Create AlertChannel Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AlertChannel(name: string, args: AlertChannelArgs, opts?: CustomResourceOptions);
@overload
def AlertChannel(resource_name: str,
args: AlertChannelArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AlertChannel(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
account_id: Optional[str] = None,
config: Optional[AlertChannelConfigArgs] = None,
name: Optional[str] = None)
func NewAlertChannel(ctx *Context, name string, args AlertChannelArgs, opts ...ResourceOption) (*AlertChannel, error)
public AlertChannel(string name, AlertChannelArgs args, CustomResourceOptions? opts = null)
public AlertChannel(String name, AlertChannelArgs args)
public AlertChannel(String name, AlertChannelArgs args, CustomResourceOptions options)
type: newrelic:AlertChannel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AlertChannelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AlertChannelArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AlertChannelArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlertChannelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AlertChannelArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var alertChannelResource = new NewRelic.AlertChannel("alertChannelResource", new()
{
Type = "string",
AccountId = "string",
Config = new NewRelic.Inputs.AlertChannelConfigArgs
{
ApiKey = "string",
AuthPassword = "string",
AuthType = "string",
AuthUsername = "string",
BaseUrl = "string",
Channel = "string",
Headers =
{
{ "string", "string" },
},
HeadersString = "string",
IncludeJsonAttachment = "string",
Key = "string",
Payload =
{
{ "string", "string" },
},
PayloadString = "string",
PayloadType = "string",
Recipients = "string",
Region = "string",
RouteKey = "string",
ServiceKey = "string",
Tags = "string",
Teams = "string",
Url = "string",
UserId = "string",
},
Name = "string",
});
example, err := newrelic.NewAlertChannel(ctx, "alertChannelResource", &newrelic.AlertChannelArgs{
Type: pulumi.String("string"),
AccountId: pulumi.String("string"),
Config: &newrelic.AlertChannelConfigArgs{
ApiKey: pulumi.String("string"),
AuthPassword: pulumi.String("string"),
AuthType: pulumi.String("string"),
AuthUsername: pulumi.String("string"),
BaseUrl: pulumi.String("string"),
Channel: pulumi.String("string"),
Headers: pulumi.StringMap{
"string": pulumi.String("string"),
},
HeadersString: pulumi.String("string"),
IncludeJsonAttachment: pulumi.String("string"),
Key: pulumi.String("string"),
Payload: pulumi.StringMap{
"string": pulumi.String("string"),
},
PayloadString: pulumi.String("string"),
PayloadType: pulumi.String("string"),
Recipients: pulumi.String("string"),
Region: pulumi.String("string"),
RouteKey: pulumi.String("string"),
ServiceKey: pulumi.String("string"),
Tags: pulumi.String("string"),
Teams: pulumi.String("string"),
Url: pulumi.String("string"),
UserId: pulumi.String("string"),
},
Name: pulumi.String("string"),
})
var alertChannelResource = new AlertChannel("alertChannelResource", AlertChannelArgs.builder()
.type("string")
.accountId("string")
.config(AlertChannelConfigArgs.builder()
.apiKey("string")
.authPassword("string")
.authType("string")
.authUsername("string")
.baseUrl("string")
.channel("string")
.headers(Map.of("string", "string"))
.headersString("string")
.includeJsonAttachment("string")
.key("string")
.payload(Map.of("string", "string"))
.payloadString("string")
.payloadType("string")
.recipients("string")
.region("string")
.routeKey("string")
.serviceKey("string")
.tags("string")
.teams("string")
.url("string")
.userId("string")
.build())
.name("string")
.build());
alert_channel_resource = newrelic.AlertChannel("alertChannelResource",
type="string",
account_id="string",
config={
"api_key": "string",
"auth_password": "string",
"auth_type": "string",
"auth_username": "string",
"base_url": "string",
"channel": "string",
"headers": {
"string": "string",
},
"headers_string": "string",
"include_json_attachment": "string",
"key": "string",
"payload": {
"string": "string",
},
"payload_string": "string",
"payload_type": "string",
"recipients": "string",
"region": "string",
"route_key": "string",
"service_key": "string",
"tags": "string",
"teams": "string",
"url": "string",
"user_id": "string",
},
name="string")
const alertChannelResource = new newrelic.AlertChannel("alertChannelResource", {
type: "string",
accountId: "string",
config: {
apiKey: "string",
authPassword: "string",
authType: "string",
authUsername: "string",
baseUrl: "string",
channel: "string",
headers: {
string: "string",
},
headersString: "string",
includeJsonAttachment: "string",
key: "string",
payload: {
string: "string",
},
payloadString: "string",
payloadType: "string",
recipients: "string",
region: "string",
routeKey: "string",
serviceKey: "string",
tags: "string",
teams: "string",
url: "string",
userId: "string",
},
name: "string",
});
type: newrelic:AlertChannel
properties:
accountId: string
config:
apiKey: string
authPassword: string
authType: string
authUsername: string
baseUrl: string
channel: string
headers:
string: string
headersString: string
includeJsonAttachment: string
key: string
payload:
string: string
payloadString: string
payloadType: string
recipients: string
region: string
routeKey: string
serviceKey: string
tags: string
teams: string
url: string
userId: string
name: string
type: string
AlertChannel Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AlertChannel resource accepts the following input properties:
- Type string
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
. - Account
Id string - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- Config
Pulumi.
New Relic. Inputs. Alert Channel Config - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- Name string
- The name of the channel.
- Type string
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
. - Account
Id string - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- Config
Alert
Channel Config Args - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- Name string
- The name of the channel.
- type String
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
. - account
Id String - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config
Alert
Channel Config - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name String
- The name of the channel.
- type string
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
. - account
Id string - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config
Alert
Channel Config - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name string
- The name of the channel.
- type str
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
. - account_
id str - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config
Alert
Channel Config Args - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name str
- The name of the channel.
- type String
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
. - account
Id String - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config Property Map
- A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name String
- The name of the channel.
Outputs
All input properties are implicitly available as output properties. Additionally, the AlertChannel resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AlertChannel Resource
Get an existing AlertChannel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AlertChannelState, opts?: CustomResourceOptions): AlertChannel
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
config: Optional[AlertChannelConfigArgs] = None,
name: Optional[str] = None,
type: Optional[str] = None) -> AlertChannel
func GetAlertChannel(ctx *Context, name string, id IDInput, state *AlertChannelState, opts ...ResourceOption) (*AlertChannel, error)
public static AlertChannel Get(string name, Input<string> id, AlertChannelState? state, CustomResourceOptions? opts = null)
public static AlertChannel get(String name, Output<String> id, AlertChannelState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Id string - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- Config
Pulumi.
New Relic. Inputs. Alert Channel Config - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- Name string
- The name of the channel.
- Type string
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
.
- Account
Id string - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- Config
Alert
Channel Config Args - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- Name string
- The name of the channel.
- Type string
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
.
- account
Id String - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config
Alert
Channel Config - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name String
- The name of the channel.
- type String
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
.
- account
Id string - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config
Alert
Channel Config - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name string
- The name of the channel.
- type string
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
.
- account_
id str - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config
Alert
Channel Config Args - A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name str
- The name of the channel.
- type str
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
.
- account
Id String - Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
- config Property Map
- A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
- name String
- The name of the channel.
- type String
- The type of channel. One of:
email
,slack
,opsgenie
,pagerduty
,victorops
, orwebhook
.
Supporting Types
AlertChannelConfig, AlertChannelConfigArgs
- Api
Key string - The API key for integrating with OpsGenie.
- Auth
Password string - Specifies an authentication password for use with a channel. Supported by the webhook channel type.
- Auth
Type string - Specifies an authentication method for use with a channel. Supported by the webhook channel type. Only HTTP basic authentication is currently supported via the value BASIC.
- Auth
Username string - Specifies an authentication username for use with a channel. Supported by the webhook channel type.
- Base
Url string - The base URL of the webhook destination.
- Channel string
- The Slack channel to send notifications to.
- Headers Dictionary<string, string>
- A map of key/value pairs that represents extra HTTP headers to be sent along with the webhook payload.
- Headers
String string - Use instead of headers if the desired payload is more complex than a list of key/value pairs (e.g. a set of headers that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with headers.
- Include
Json stringAttachment - true or false. Flag for whether or not to attach a JSON document containing information about the associated alert to the email that is sent to recipients.
- Key string
- The key for integrating with VictorOps.
- Payload Dictionary<string, string>
- A map of key/value pairs that represents the webhook payload. Must provide payload_type if setting this argument.
- Payload
String string - Use instead of payload if the desired payload is more complex than a list of key/value pairs (e.g. a payload that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with payload.
- Payload
Type string - Can either be application/json or application/x-www-form-urlencoded. The payload_type argument is required if payload is set.
- Recipients string
- A set of recipients for targeting notifications. Multiple values are comma separated.
- Region string
- The data center region to store your data. Valid values are US and EU. Default is US.
- Route
Key string - The route key for integrating with VictorOps.
- Service
Key string - Specifies the service key for integrating with Pagerduty.
- string
- A set of tags for targeting notifications. Multiple values are comma separated.
- Teams string
- A set of teams for targeting notifications. Multiple values are comma separated.
- Url string
- Your organization's Slack URL.
- User
Id string - The user ID for use with the user channel type.
- Api
Key string - The API key for integrating with OpsGenie.
- Auth
Password string - Specifies an authentication password for use with a channel. Supported by the webhook channel type.
- Auth
Type string - Specifies an authentication method for use with a channel. Supported by the webhook channel type. Only HTTP basic authentication is currently supported via the value BASIC.
- Auth
Username string - Specifies an authentication username for use with a channel. Supported by the webhook channel type.
- Base
Url string - The base URL of the webhook destination.
- Channel string
- The Slack channel to send notifications to.
- Headers map[string]string
- A map of key/value pairs that represents extra HTTP headers to be sent along with the webhook payload.
- Headers
String string - Use instead of headers if the desired payload is more complex than a list of key/value pairs (e.g. a set of headers that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with headers.
- Include
Json stringAttachment - true or false. Flag for whether or not to attach a JSON document containing information about the associated alert to the email that is sent to recipients.
- Key string
- The key for integrating with VictorOps.
- Payload map[string]string
- A map of key/value pairs that represents the webhook payload. Must provide payload_type if setting this argument.
- Payload
String string - Use instead of payload if the desired payload is more complex than a list of key/value pairs (e.g. a payload that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with payload.
- Payload
Type string - Can either be application/json or application/x-www-form-urlencoded. The payload_type argument is required if payload is set.
- Recipients string
- A set of recipients for targeting notifications. Multiple values are comma separated.
- Region string
- The data center region to store your data. Valid values are US and EU. Default is US.
- Route
Key string - The route key for integrating with VictorOps.
- Service
Key string - Specifies the service key for integrating with Pagerduty.
- string
- A set of tags for targeting notifications. Multiple values are comma separated.
- Teams string
- A set of teams for targeting notifications. Multiple values are comma separated.
- Url string
- Your organization's Slack URL.
- User
Id string - The user ID for use with the user channel type.
- api
Key String - The API key for integrating with OpsGenie.
- auth
Password String - Specifies an authentication password for use with a channel. Supported by the webhook channel type.
- auth
Type String - Specifies an authentication method for use with a channel. Supported by the webhook channel type. Only HTTP basic authentication is currently supported via the value BASIC.
- auth
Username String - Specifies an authentication username for use with a channel. Supported by the webhook channel type.
- base
Url String - The base URL of the webhook destination.
- channel String
- The Slack channel to send notifications to.
- headers Map<String,String>
- A map of key/value pairs that represents extra HTTP headers to be sent along with the webhook payload.
- headers
String String - Use instead of headers if the desired payload is more complex than a list of key/value pairs (e.g. a set of headers that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with headers.
- include
Json StringAttachment - true or false. Flag for whether or not to attach a JSON document containing information about the associated alert to the email that is sent to recipients.
- key String
- The key for integrating with VictorOps.
- payload Map<String,String>
- A map of key/value pairs that represents the webhook payload. Must provide payload_type if setting this argument.
- payload
String String - Use instead of payload if the desired payload is more complex than a list of key/value pairs (e.g. a payload that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with payload.
- payload
Type String - Can either be application/json or application/x-www-form-urlencoded. The payload_type argument is required if payload is set.
- recipients String
- A set of recipients for targeting notifications. Multiple values are comma separated.
- region String
- The data center region to store your data. Valid values are US and EU. Default is US.
- route
Key String - The route key for integrating with VictorOps.
- service
Key String - Specifies the service key for integrating with Pagerduty.
- String
- A set of tags for targeting notifications. Multiple values are comma separated.
- teams String
- A set of teams for targeting notifications. Multiple values are comma separated.
- url String
- Your organization's Slack URL.
- user
Id String - The user ID for use with the user channel type.
- api
Key string - The API key for integrating with OpsGenie.
- auth
Password string - Specifies an authentication password for use with a channel. Supported by the webhook channel type.
- auth
Type string - Specifies an authentication method for use with a channel. Supported by the webhook channel type. Only HTTP basic authentication is currently supported via the value BASIC.
- auth
Username string - Specifies an authentication username for use with a channel. Supported by the webhook channel type.
- base
Url string - The base URL of the webhook destination.
- channel string
- The Slack channel to send notifications to.
- headers {[key: string]: string}
- A map of key/value pairs that represents extra HTTP headers to be sent along with the webhook payload.
- headers
String string - Use instead of headers if the desired payload is more complex than a list of key/value pairs (e.g. a set of headers that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with headers.
- include
Json stringAttachment - true or false. Flag for whether or not to attach a JSON document containing information about the associated alert to the email that is sent to recipients.
- key string
- The key for integrating with VictorOps.
- payload {[key: string]: string}
- A map of key/value pairs that represents the webhook payload. Must provide payload_type if setting this argument.
- payload
String string - Use instead of payload if the desired payload is more complex than a list of key/value pairs (e.g. a payload that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with payload.
- payload
Type string - Can either be application/json or application/x-www-form-urlencoded. The payload_type argument is required if payload is set.
- recipients string
- A set of recipients for targeting notifications. Multiple values are comma separated.
- region string
- The data center region to store your data. Valid values are US and EU. Default is US.
- route
Key string - The route key for integrating with VictorOps.
- service
Key string - Specifies the service key for integrating with Pagerduty.
- string
- A set of tags for targeting notifications. Multiple values are comma separated.
- teams string
- A set of teams for targeting notifications. Multiple values are comma separated.
- url string
- Your organization's Slack URL.
- user
Id string - The user ID for use with the user channel type.
- api_
key str - The API key for integrating with OpsGenie.
- auth_
password str - Specifies an authentication password for use with a channel. Supported by the webhook channel type.
- auth_
type str - Specifies an authentication method for use with a channel. Supported by the webhook channel type. Only HTTP basic authentication is currently supported via the value BASIC.
- auth_
username str - Specifies an authentication username for use with a channel. Supported by the webhook channel type.
- base_
url str - The base URL of the webhook destination.
- channel str
- The Slack channel to send notifications to.
- headers Mapping[str, str]
- A map of key/value pairs that represents extra HTTP headers to be sent along with the webhook payload.
- headers_
string str - Use instead of headers if the desired payload is more complex than a list of key/value pairs (e.g. a set of headers that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with headers.
- include_
json_ strattachment - true or false. Flag for whether or not to attach a JSON document containing information about the associated alert to the email that is sent to recipients.
- key str
- The key for integrating with VictorOps.
- payload Mapping[str, str]
- A map of key/value pairs that represents the webhook payload. Must provide payload_type if setting this argument.
- payload_
string str - Use instead of payload if the desired payload is more complex than a list of key/value pairs (e.g. a payload that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with payload.
- payload_
type str - Can either be application/json or application/x-www-form-urlencoded. The payload_type argument is required if payload is set.
- recipients str
- A set of recipients for targeting notifications. Multiple values are comma separated.
- region str
- The data center region to store your data. Valid values are US and EU. Default is US.
- route_
key str - The route key for integrating with VictorOps.
- service_
key str - Specifies the service key for integrating with Pagerduty.
- str
- A set of tags for targeting notifications. Multiple values are comma separated.
- teams str
- A set of teams for targeting notifications. Multiple values are comma separated.
- url str
- Your organization's Slack URL.
- user_
id str - The user ID for use with the user channel type.
- api
Key String - The API key for integrating with OpsGenie.
- auth
Password String - Specifies an authentication password for use with a channel. Supported by the webhook channel type.
- auth
Type String - Specifies an authentication method for use with a channel. Supported by the webhook channel type. Only HTTP basic authentication is currently supported via the value BASIC.
- auth
Username String - Specifies an authentication username for use with a channel. Supported by the webhook channel type.
- base
Url String - The base URL of the webhook destination.
- channel String
- The Slack channel to send notifications to.
- headers Map<String>
- A map of key/value pairs that represents extra HTTP headers to be sent along with the webhook payload.
- headers
String String - Use instead of headers if the desired payload is more complex than a list of key/value pairs (e.g. a set of headers that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with headers.
- include
Json StringAttachment - true or false. Flag for whether or not to attach a JSON document containing information about the associated alert to the email that is sent to recipients.
- key String
- The key for integrating with VictorOps.
- payload Map<String>
- A map of key/value pairs that represents the webhook payload. Must provide payload_type if setting this argument.
- payload
String String - Use instead of payload if the desired payload is more complex than a list of key/value pairs (e.g. a payload that makes use of nested objects). The value provided should be a valid JSON string with escaped double quotes. Conflicts with payload.
- payload
Type String - Can either be application/json or application/x-www-form-urlencoded. The payload_type argument is required if payload is set.
- recipients String
- A set of recipients for targeting notifications. Multiple values are comma separated.
- region String
- The data center region to store your data. Valid values are US and EU. Default is US.
- route
Key String - The route key for integrating with VictorOps.
- service
Key String - Specifies the service key for integrating with Pagerduty.
- String
- A set of tags for targeting notifications. Multiple values are comma separated.
- teams String
- A set of teams for targeting notifications. Multiple values are comma separated.
- url String
- Your organization's Slack URL.
- user
Id String - The user ID for use with the user channel type.
Import
Alert channels can be imported using the id
, e.g.
bash
$ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelic
Terraform Provider.