newrelic.Workflow
Explore with Pulumi AI
Use this resource to create and manage New Relic workflows.
Policy-Based Workflow Example
This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
// Create a policy to track
const my_policy = new newrelic.AlertPolicy("my-policy", {});
// Create a reusable notification destination
const webhook_destination = new newrelic.NotificationDestination("webhook-destination", {
type: "WEBHOOK",
properties: [{
key: "url",
value: "https://example.com",
}],
authBasic: {
user: "username",
password: "password",
},
});
// Create a notification channel to use in the workflow
const webhook_channel = new newrelic.NotificationChannel("webhook-channel", {
type: "WEBHOOK",
destinationId: webhook_destination.id,
product: "IINT",
properties: [{
key: "payload",
value: "{}",
label: "Payload Template",
}],
});
// A workflow that matches issues that include incidents triggered by the policy
const workflow_example = new newrelic.Workflow("workflow-example", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "labels.policyIds",
operator: "EXACTLY_MATCHES",
values: [my_policy.id],
}],
},
destinations: [{
channelId: webhook_channel.id,
}],
});
import pulumi
import pulumi_newrelic as newrelic
# Create a policy to track
my_policy = newrelic.AlertPolicy("my-policy")
# Create a reusable notification destination
webhook_destination = newrelic.NotificationDestination("webhook-destination",
type="WEBHOOK",
properties=[newrelic.NotificationDestinationPropertyArgs(
key="url",
value="https://example.com",
)],
auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
user="username",
password="password",
))
# Create a notification channel to use in the workflow
webhook_channel = newrelic.NotificationChannel("webhook-channel",
type="WEBHOOK",
destination_id=webhook_destination.id,
product="IINT",
properties=[newrelic.NotificationChannelPropertyArgs(
key="payload",
value="{}",
label="Payload Template",
)])
# A workflow that matches issues that include incidents triggered by the policy
workflow_example = newrelic.Workflow("workflow-example",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="Filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="labels.policyIds",
operator="EXACTLY_MATCHES",
values=[my_policy.id],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=webhook_channel.id,
)])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
// Create a policy to track
var my_policy = new NewRelic.AlertPolicy("my-policy");
// Create a reusable notification destination
var webhook_destination = new NewRelic.NotificationDestination("webhook-destination", new()
{
Type = "WEBHOOK",
Properties = new[]
{
new NewRelic.Inputs.NotificationDestinationPropertyArgs
{
Key = "url",
Value = "https://example.com",
},
},
AuthBasic = new NewRelic.Inputs.NotificationDestinationAuthBasicArgs
{
User = "username",
Password = "password",
},
});
// Create a notification channel to use in the workflow
var webhook_channel = new NewRelic.NotificationChannel("webhook-channel", new()
{
Type = "WEBHOOK",
DestinationId = webhook_destination.Id,
Product = "IINT",
Properties = new[]
{
new NewRelic.Inputs.NotificationChannelPropertyArgs
{
Key = "payload",
Value = "{}",
Label = "Payload Template",
},
},
});
// A workflow that matches issues that include incidents triggered by the policy
var workflow_example = new NewRelic.Workflow("workflow-example", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "Filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "labels.policyIds",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
my_policy.Id,
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = webhook_channel.Id,
},
},
});
});
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.NewAlertPolicy(ctx, "my-policy", nil)
if err != nil {
return err
}
_, err = newrelic.NewNotificationDestination(ctx, "webhook-destination", &newrelic.NotificationDestinationArgs{
Type: pulumi.String("WEBHOOK"),
Properties: newrelic.NotificationDestinationPropertyArray{
&newrelic.NotificationDestinationPropertyArgs{
Key: pulumi.String("url"),
Value: pulumi.String("https://example.com"),
},
},
AuthBasic: &newrelic.NotificationDestinationAuthBasicArgs{
User: pulumi.String("username"),
Password: pulumi.String("password"),
},
})
if err != nil {
return err
}
_, err = newrelic.NewNotificationChannel(ctx, "webhook-channel", &newrelic.NotificationChannelArgs{
Type: pulumi.String("WEBHOOK"),
DestinationId: webhook_destination.ID(),
Product: pulumi.String("IINT"),
Properties: newrelic.NotificationChannelPropertyArray{
&newrelic.NotificationChannelPropertyArgs{
Key: pulumi.String("payload"),
Value: pulumi.String("{}"),
Label: pulumi.String("Payload Template"),
},
},
})
if err != nil {
return err
}
_, err = newrelic.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("Filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("labels.policyIds"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
my_policy.ID(),
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: webhook_channel.ID(),
},
},
})
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.AlertPolicy;
import com.pulumi.newrelic.NotificationDestination;
import com.pulumi.newrelic.NotificationDestinationArgs;
import com.pulumi.newrelic.inputs.NotificationDestinationPropertyArgs;
import com.pulumi.newrelic.inputs.NotificationDestinationAuthBasicArgs;
import com.pulumi.newrelic.NotificationChannel;
import com.pulumi.newrelic.NotificationChannelArgs;
import com.pulumi.newrelic.inputs.NotificationChannelPropertyArgs;
import com.pulumi.newrelic.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 my_policy = new AlertPolicy("my-policy");
var webhook_destination = new NotificationDestination("webhook-destination", NotificationDestinationArgs.builder()
.type("WEBHOOK")
.properties(NotificationDestinationPropertyArgs.builder()
.key("url")
.value("https://example.com")
.build())
.authBasic(NotificationDestinationAuthBasicArgs.builder()
.user("username")
.password("password")
.build())
.build());
var webhook_channel = new NotificationChannel("webhook-channel", NotificationChannelArgs.builder()
.type("WEBHOOK")
.destinationId(webhook_destination.id())
.product("IINT")
.properties(NotificationChannelPropertyArgs.builder()
.key("payload")
.value("{}")
.label("Payload Template")
.build())
.build());
var workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("Filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("labels.policyIds")
.operator("EXACTLY_MATCHES")
.values(my_policy.id())
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(webhook_channel.id())
.build())
.build());
}
}
resources:
# Create a policy to track
my-policy:
type: newrelic:AlertPolicy
# Create a reusable notification destination
webhook-destination:
type: newrelic:NotificationDestination
properties:
type: WEBHOOK
properties:
- key: url
value: https://example.com
authBasic:
user: username
password: password
# Create a notification channel to use in the workflow
webhook-channel:
type: newrelic:NotificationChannel
properties:
type: WEBHOOK
destinationId: ${["webhook-destination"].id}
product: IINT # Please note the product used!
properties:
- key: payload
value: '{}'
label: Payload Template
# A workflow that matches issues that include incidents triggered by the policy
workflow-example:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: Filter-name
type: FILTER
predicates:
- attribute: labels.policyIds
operator: EXACTLY_MATCHES
values:
- ${["my-policy"].id}
destinations:
- channelId: ${["webhook-channel"].id}
An example of a workflow with enrichments
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const workflow_example = new newrelic.Workflow("workflow-example", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "accumulations.tag.team",
operator: "EXACTLY_MATCHES",
values: ["my_team"],
}],
},
enrichments: {
nrqls: [{
name: "Log Count",
configurations: [{
query: "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
}],
}],
},
destinations: [{
channelId: newrelic_notification_channel["webhook-channel"].id,
}],
});
import pulumi
import pulumi_newrelic as newrelic
workflow_example = newrelic.Workflow("workflow-example",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="Filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="accumulations.tag.team",
operator="EXACTLY_MATCHES",
values=["my_team"],
)],
),
enrichments=newrelic.WorkflowEnrichmentsArgs(
nrqls=[newrelic.WorkflowEnrichmentsNrqlArgs(
name="Log Count",
configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
query="SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
)],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
)])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var workflow_example = new NewRelic.Workflow("workflow-example", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "Filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "accumulations.tag.team",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
"my_team",
},
},
},
},
Enrichments = new NewRelic.Inputs.WorkflowEnrichmentsArgs
{
Nrqls = new[]
{
new NewRelic.Inputs.WorkflowEnrichmentsNrqlArgs
{
Name = "Log Count",
Configurations = new[]
{
new NewRelic.Inputs.WorkflowEnrichmentsNrqlConfigurationArgs
{
Query = "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
},
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = newrelic_notification_channel.Webhook_channel.Id,
},
},
});
});
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.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("Filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("accumulations.tag.team"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
pulumi.String("my_team"),
},
},
},
},
Enrichments: &newrelic.WorkflowEnrichmentsArgs{
Nrqls: newrelic.WorkflowEnrichmentsNrqlArray{
&newrelic.WorkflowEnrichmentsNrqlArgs{
Name: pulumi.String("Log Count"),
Configurations: newrelic.WorkflowEnrichmentsNrqlConfigurationArray{
&newrelic.WorkflowEnrichmentsNrqlConfigurationArgs{
Query: pulumi.String("SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago"),
},
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: pulumi.Any(newrelic_notification_channel.WebhookChannel.Id),
},
},
})
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.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowEnrichmentsArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("Filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("accumulations.tag.team")
.operator("EXACTLY_MATCHES")
.values("my_team")
.build())
.build())
.enrichments(WorkflowEnrichmentsArgs.builder()
.nrqls(WorkflowEnrichmentsNrqlArgs.builder()
.name("Log Count")
.configurations(WorkflowEnrichmentsNrqlConfigurationArgs.builder()
.query("SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago")
.build())
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(newrelic_notification_channel.webhook-channel().id())
.build())
.build());
}
}
resources:
workflow-example:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: Filter-name
type: FILTER
predicates:
- attribute: accumulations.tag.team
operator: EXACTLY_MATCHES
values:
- my_team
enrichments:
nrqls:
- name: Log Count
configurations:
- query: SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago
destinations:
- channelId: ${newrelic_notification_channel"webhook-channel"[%!s(MISSING)].id}
An example of a workflow with notification triggers
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const workflow_example = new newrelic.Workflow("workflow-example", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "accumulations.tag.team",
operator: "EXACTLY_MATCHES",
values: ["my_team"],
}],
},
destinations: [{
channelId: newrelic_notification_channel["webhook-channel"].id,
notificationTriggers: ["ACTIVATED"],
}],
});
import pulumi
import pulumi_newrelic as newrelic
workflow_example = newrelic.Workflow("workflow-example",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="Filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="accumulations.tag.team",
operator="EXACTLY_MATCHES",
values=["my_team"],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
notification_triggers=["ACTIVATED"],
)])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var workflow_example = new NewRelic.Workflow("workflow-example", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "Filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "accumulations.tag.team",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
"my_team",
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = newrelic_notification_channel.Webhook_channel.Id,
NotificationTriggers = new[]
{
"ACTIVATED",
},
},
},
});
});
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.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("Filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("accumulations.tag.team"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
pulumi.String("my_team"),
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: pulumi.Any(newrelic_notification_channel.WebhookChannel.Id),
NotificationTriggers: pulumi.StringArray{
pulumi.String("ACTIVATED"),
},
},
},
})
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.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("Filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("accumulations.tag.team")
.operator("EXACTLY_MATCHES")
.values("my_team")
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(newrelic_notification_channel.webhook-channel().id())
.notificationTriggers("ACTIVATED")
.build())
.build());
}
}
resources:
workflow-example:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: Filter-name
type: FILTER
predicates:
- attribute: accumulations.tag.team
operator: EXACTLY_MATCHES
values:
- my_team
destinations:
- channelId: ${newrelic_notification_channel"webhook-channel"[%!s(MISSING)].id}
notificationTriggers:
- ACTIVATED
Additional Information
More details about the workflows can be found here.
v3.3 changes
In version v3.3 we renamed the following arguments:
workflow_enabled
changed toenabled
.destination_configuration
changed todestination
.predicates
changed topredicate
.- Enrichment’s
configurations
changed toconfiguration
.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.Workflow("foo", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "accumulations.tag.team",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
"growth",
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = newrelic_notification_channel.Some_channel.Id,
},
},
});
});
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.NewWorkflow(ctx, "foo", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("accumulations.tag.team"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
pulumi.String("growth"),
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: pulumi.Any(newrelic_notification_channel.Some_channel.Id),
},
},
})
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.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 Workflow("foo", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("accumulations.tag.team")
.operator("EXACTLY_MATCHES")
.values("growth")
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(newrelic_notification_channel.some_channel().id())
.build())
.build());
}
}
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.Workflow("foo",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="accumulations.tag.team",
operator="EXACTLY_MATCHES",
values=["growth"],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
)])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.Workflow("foo", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "filter-name",
type: "FILTER",
predicates: [{
attribute: "accumulations.tag.team",
operator: "EXACTLY_MATCHES",
values: ["growth"],
}],
},
destinations: [{
channelId: newrelic_notification_channel.some_channel.id,
}],
});
resources:
foo:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: filter-name
type: FILTER
predicates:
- attribute: accumulations.tag.team
operator: EXACTLY_MATCHES
values:
- growth
destinations:
- channelId: ${newrelic_notification_channel.some_channel.id}
This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
// Create a policy to track
var my_policy = new NewRelic.AlertPolicy("my-policy");
// Create a reusable notification destination
var webhook_destination = new NewRelic.NotificationDestination("webhook-destination", new()
{
Type = "WEBHOOK",
Properties = new[]
{
new NewRelic.Inputs.NotificationDestinationPropertyArgs
{
Key = "url",
Value = "https://example.com",
},
},
AuthBasic = new NewRelic.Inputs.NotificationDestinationAuthBasicArgs
{
User = "username",
Password = "password",
},
});
// Create a notification channel to use in the workflow
var webhook_channel = new NewRelic.NotificationChannel("webhook-channel", new()
{
Type = "WEBHOOK",
DestinationId = webhook_destination.Id,
Product = "IINT",
Properties = new[]
{
new NewRelic.Inputs.NotificationChannelPropertyArgs
{
Key = "payload",
Value = "{}",
Label = "Payload Template",
},
},
});
// A workflow that matches issues that include incidents triggered by the policy
var workflow_example = new NewRelic.Workflow("workflow-example", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "Filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "labels.policyIds",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
my_policy.Id,
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = webhook_channel.Id,
},
},
});
});
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.NewAlertPolicy(ctx, "my-policy", nil)
if err != nil {
return err
}
_, err = newrelic.NewNotificationDestination(ctx, "webhook-destination", &newrelic.NotificationDestinationArgs{
Type: pulumi.String("WEBHOOK"),
Properties: newrelic.NotificationDestinationPropertyArray{
&newrelic.NotificationDestinationPropertyArgs{
Key: pulumi.String("url"),
Value: pulumi.String("https://example.com"),
},
},
AuthBasic: &newrelic.NotificationDestinationAuthBasicArgs{
User: pulumi.String("username"),
Password: pulumi.String("password"),
},
})
if err != nil {
return err
}
_, err = newrelic.NewNotificationChannel(ctx, "webhook-channel", &newrelic.NotificationChannelArgs{
Type: pulumi.String("WEBHOOK"),
DestinationId: webhook_destination.ID(),
Product: pulumi.String("IINT"),
Properties: newrelic.NotificationChannelPropertyArray{
&newrelic.NotificationChannelPropertyArgs{
Key: pulumi.String("payload"),
Value: pulumi.String("{}"),
Label: pulumi.String("Payload Template"),
},
},
})
if err != nil {
return err
}
_, err = newrelic.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("Filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("labels.policyIds"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
my_policy.ID(),
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: webhook_channel.ID(),
},
},
})
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.AlertPolicy;
import com.pulumi.newrelic.NotificationDestination;
import com.pulumi.newrelic.NotificationDestinationArgs;
import com.pulumi.newrelic.inputs.NotificationDestinationPropertyArgs;
import com.pulumi.newrelic.inputs.NotificationDestinationAuthBasicArgs;
import com.pulumi.newrelic.NotificationChannel;
import com.pulumi.newrelic.NotificationChannelArgs;
import com.pulumi.newrelic.inputs.NotificationChannelPropertyArgs;
import com.pulumi.newrelic.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 my_policy = new AlertPolicy("my-policy");
var webhook_destination = new NotificationDestination("webhook-destination", NotificationDestinationArgs.builder()
.type("WEBHOOK")
.properties(NotificationDestinationPropertyArgs.builder()
.key("url")
.value("https://example.com")
.build())
.authBasic(NotificationDestinationAuthBasicArgs.builder()
.user("username")
.password("password")
.build())
.build());
var webhook_channel = new NotificationChannel("webhook-channel", NotificationChannelArgs.builder()
.type("WEBHOOK")
.destinationId(webhook_destination.id())
.product("IINT")
.properties(NotificationChannelPropertyArgs.builder()
.key("payload")
.value("{}")
.label("Payload Template")
.build())
.build());
var workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("Filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("labels.policyIds")
.operator("EXACTLY_MATCHES")
.values(my_policy.id())
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(webhook_channel.id())
.build())
.build());
}
}
import pulumi
import pulumi_newrelic as newrelic
# Create a policy to track
my_policy = newrelic.AlertPolicy("my-policy")
# Create a reusable notification destination
webhook_destination = newrelic.NotificationDestination("webhook-destination",
type="WEBHOOK",
properties=[newrelic.NotificationDestinationPropertyArgs(
key="url",
value="https://example.com",
)],
auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
user="username",
password="password",
))
# Create a notification channel to use in the workflow
webhook_channel = newrelic.NotificationChannel("webhook-channel",
type="WEBHOOK",
destination_id=webhook_destination.id,
product="IINT",
properties=[newrelic.NotificationChannelPropertyArgs(
key="payload",
value="{}",
label="Payload Template",
)])
# A workflow that matches issues that include incidents triggered by the policy
workflow_example = newrelic.Workflow("workflow-example",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="Filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="labels.policyIds",
operator="EXACTLY_MATCHES",
values=[my_policy.id],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=webhook_channel.id,
)])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
// Create a policy to track
const my_policy = new newrelic.AlertPolicy("my-policy", {});
// Create a reusable notification destination
const webhook_destination = new newrelic.NotificationDestination("webhook-destination", {
type: "WEBHOOK",
properties: [{
key: "url",
value: "https://example.com",
}],
authBasic: {
user: "username",
password: "password",
},
});
// Create a notification channel to use in the workflow
const webhook_channel = new newrelic.NotificationChannel("webhook-channel", {
type: "WEBHOOK",
destinationId: webhook_destination.id,
product: "IINT",
properties: [{
key: "payload",
value: "{}",
label: "Payload Template",
}],
});
// A workflow that matches issues that include incidents triggered by the policy
const workflow_example = new newrelic.Workflow("workflow-example", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "labels.policyIds",
operator: "EXACTLY_MATCHES",
values: [my_policy.id],
}],
},
destinations: [{
channelId: webhook_channel.id,
}],
});
resources:
# Create a policy to track
my-policy:
type: newrelic:AlertPolicy
# Create a reusable notification destination
webhook-destination:
type: newrelic:NotificationDestination
properties:
type: WEBHOOK
properties:
- key: url
value: https://example.com
authBasic:
user: username
password: password
# Create a notification channel to use in the workflow
webhook-channel:
type: newrelic:NotificationChannel
properties:
type: WEBHOOK
destinationId: ${["webhook-destination"].id}
product: IINT # Please note the product used!
properties:
- key: payload
value: '{}'
label: Payload Template
# A workflow that matches issues that include incidents triggered by the policy
workflow-example:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: Filter-name
type: FILTER
predicates:
- attribute: labels.policyIds
operator: EXACTLY_MATCHES
values:
- ${["my-policy"].id}
destinations:
- channelId: ${["webhook-channel"].id}
An example of a workflow with enrichments
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var workflow_example = new NewRelic.Workflow("workflow-example", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "Filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "accumulations.tag.team",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
"my_team",
},
},
},
},
Enrichments = new NewRelic.Inputs.WorkflowEnrichmentsArgs
{
Nrqls = new[]
{
new NewRelic.Inputs.WorkflowEnrichmentsNrqlArgs
{
Name = "Log Count",
Configurations = new[]
{
new NewRelic.Inputs.WorkflowEnrichmentsNrqlConfigurationArgs
{
Query = "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
},
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = newrelic_notification_channel.Webhook_channel.Id,
},
},
});
});
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.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("Filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("accumulations.tag.team"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
pulumi.String("my_team"),
},
},
},
},
Enrichments: &newrelic.WorkflowEnrichmentsArgs{
Nrqls: newrelic.WorkflowEnrichmentsNrqlArray{
&newrelic.WorkflowEnrichmentsNrqlArgs{
Name: pulumi.String("Log Count"),
Configurations: newrelic.WorkflowEnrichmentsNrqlConfigurationArray{
&newrelic.WorkflowEnrichmentsNrqlConfigurationArgs{
Query: pulumi.String("SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago"),
},
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: pulumi.Any(newrelic_notification_channel.WebhookChannel.Id),
},
},
})
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.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowEnrichmentsArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("Filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("accumulations.tag.team")
.operator("EXACTLY_MATCHES")
.values("my_team")
.build())
.build())
.enrichments(WorkflowEnrichmentsArgs.builder()
.nrqls(WorkflowEnrichmentsNrqlArgs.builder()
.name("Log Count")
.configurations(WorkflowEnrichmentsNrqlConfigurationArgs.builder()
.query("SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago")
.build())
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(newrelic_notification_channel.webhook-channel().id())
.build())
.build());
}
}
import pulumi
import pulumi_newrelic as newrelic
workflow_example = newrelic.Workflow("workflow-example",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="Filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="accumulations.tag.team",
operator="EXACTLY_MATCHES",
values=["my_team"],
)],
),
enrichments=newrelic.WorkflowEnrichmentsArgs(
nrqls=[newrelic.WorkflowEnrichmentsNrqlArgs(
name="Log Count",
configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
query="SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
)],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
)])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const workflow_example = new newrelic.Workflow("workflow-example", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "accumulations.tag.team",
operator: "EXACTLY_MATCHES",
values: ["my_team"],
}],
},
enrichments: {
nrqls: [{
name: "Log Count",
configurations: [{
query: "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
}],
}],
},
destinations: [{
channelId: newrelic_notification_channel["webhook-channel"].id,
}],
});
resources:
workflow-example:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: Filter-name
type: FILTER
predicates:
- attribute: accumulations.tag.team
operator: EXACTLY_MATCHES
values:
- my_team
enrichments:
nrqls:
- name: Log Count
configurations:
- query: SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago
destinations:
- channelId: ${newrelic_notification_channel"webhook-channel"[%!s(MISSING)].id}
An example of a workflow with notification triggers
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var workflow_example = new NewRelic.Workflow("workflow-example", new()
{
MutingRulesHandling = "NOTIFY_ALL_ISSUES",
IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
{
Name = "Filter-name",
Type = "FILTER",
Predicates = new[]
{
new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
{
Attribute = "accumulations.tag.team",
Operator = "EXACTLY_MATCHES",
Values = new[]
{
"my_team",
},
},
},
},
Destinations = new[]
{
new NewRelic.Inputs.WorkflowDestinationArgs
{
ChannelId = newrelic_notification_channel.Webhook_channel.Id,
NotificationTriggers = new[]
{
"ACTIVATED",
},
},
},
});
});
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.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
Name: pulumi.String("Filter-name"),
Type: pulumi.String("FILTER"),
Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
&newrelic.WorkflowIssuesFilterPredicateArgs{
Attribute: pulumi.String("accumulations.tag.team"),
Operator: pulumi.String("EXACTLY_MATCHES"),
Values: pulumi.StringArray{
pulumi.String("my_team"),
},
},
},
},
Destinations: newrelic.WorkflowDestinationArray{
&newrelic.WorkflowDestinationArgs{
ChannelId: pulumi.Any(newrelic_notification_channel.WebhookChannel.Id),
NotificationTriggers: pulumi.StringArray{
pulumi.String("ACTIVATED"),
},
},
},
})
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.Workflow;
import com.pulumi.newrelic.WorkflowArgs;
import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
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 workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
.mutingRulesHandling("NOTIFY_ALL_ISSUES")
.issuesFilter(WorkflowIssuesFilterArgs.builder()
.name("Filter-name")
.type("FILTER")
.predicates(WorkflowIssuesFilterPredicateArgs.builder()
.attribute("accumulations.tag.team")
.operator("EXACTLY_MATCHES")
.values("my_team")
.build())
.build())
.destinations(WorkflowDestinationArgs.builder()
.channelId(newrelic_notification_channel.webhook-channel().id())
.notificationTriggers("ACTIVATED")
.build())
.build());
}
}
import pulumi
import pulumi_newrelic as newrelic
workflow_example = newrelic.Workflow("workflow-example",
muting_rules_handling="NOTIFY_ALL_ISSUES",
issues_filter=newrelic.WorkflowIssuesFilterArgs(
name="Filter-name",
type="FILTER",
predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
attribute="accumulations.tag.team",
operator="EXACTLY_MATCHES",
values=["my_team"],
)],
),
destinations=[newrelic.WorkflowDestinationArgs(
channel_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
notification_triggers=["ACTIVATED"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const workflow_example = new newrelic.Workflow("workflow-example", {
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "accumulations.tag.team",
operator: "EXACTLY_MATCHES",
values: ["my_team"],
}],
},
destinations: [{
channelId: newrelic_notification_channel["webhook-channel"].id,
notificationTriggers: ["ACTIVATED"],
}],
});
resources:
workflow-example:
type: newrelic:Workflow
properties:
mutingRulesHandling: NOTIFY_ALL_ISSUES
issuesFilter:
name: Filter-name
type: FILTER
predicates:
- attribute: accumulations.tag.team
operator: EXACTLY_MATCHES
values:
- my_team
destinations:
- channelId: ${newrelic_notification_channel"webhook-channel"[%!s(MISSING)].id}
notificationTriggers:
- ACTIVATED
Create Workflow Resource
new Workflow(name: string, args: WorkflowArgs, opts?: CustomResourceOptions);
@overload
def Workflow(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
destinations: Optional[Sequence[WorkflowDestinationArgs]] = None,
destinations_enabled: Optional[bool] = None,
enabled: Optional[bool] = None,
enrichments: Optional[WorkflowEnrichmentsArgs] = None,
enrichments_enabled: Optional[bool] = None,
issues_filter: Optional[WorkflowIssuesFilterArgs] = None,
muting_rules_handling: Optional[str] = None,
name: Optional[str] = None)
@overload
def Workflow(resource_name: str,
args: WorkflowArgs,
opts: Optional[ResourceOptions] = None)
func NewWorkflow(ctx *Context, name string, args WorkflowArgs, opts ...ResourceOption) (*Workflow, error)
public Workflow(string name, WorkflowArgs args, CustomResourceOptions? opts = null)
public Workflow(String name, WorkflowArgs args)
public Workflow(String name, WorkflowArgs args, CustomResourceOptions options)
type: newrelic:Workflow
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkflowArgs
- 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 WorkflowArgs
- 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 WorkflowArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Workflow Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Workflow resource accepts the following input properties:
- Destinations
List<Pulumi.
New Relic. Inputs. Workflow Destination Args> Notification configuration. See Nested destination blocks below for details.
- Issues
Filter Pulumi.New Relic. Inputs. Workflow Issues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- Muting
Rules stringHandling How to handle muted issues. See Muting Rules below for details.
- Account
Id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- Destinations
Enabled bool DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- Enabled bool
Whether workflow is enabled. Defaults to true.
- Enrichments
Pulumi.
New Relic. Inputs. Workflow Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- Enrichments
Enabled bool Whether enrichments are enabled. Defaults to true.
- Name string
The name of the workflow.
- Destinations
[]Workflow
Destination Args Notification configuration. See Nested destination blocks below for details.
- Issues
Filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- Muting
Rules stringHandling How to handle muted issues. See Muting Rules below for details.
- Account
Id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- Destinations
Enabled bool DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- Enabled bool
Whether workflow is enabled. Defaults to true.
- Enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- Enrichments
Enabled bool Whether enrichments are enabled. Defaults to true.
- Name string
The name of the workflow.
- destinations
List<Workflow
Destination Args> Notification configuration. See Nested destination blocks below for details.
- issues
Filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- muting
Rules StringHandling How to handle muted issues. See Muting Rules below for details.
- account
Id Integer Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations
Enabled Boolean DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled Boolean
Whether workflow is enabled. Defaults to true.
- enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments
Enabled Boolean Whether enrichments are enabled. Defaults to true.
- name String
The name of the workflow.
- destinations
Workflow
Destination Args[] Notification configuration. See Nested destination blocks below for details.
- issues
Filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- muting
Rules stringHandling How to handle muted issues. See Muting Rules below for details.
- account
Id number Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations
Enabled boolean DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled boolean
Whether workflow is enabled. Defaults to true.
- enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments
Enabled boolean Whether enrichments are enabled. Defaults to true.
- name string
The name of the workflow.
- destinations
Sequence[Workflow
Destination Args] Notification configuration. See Nested destination blocks below for details.
- issues_
filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- muting_
rules_ strhandling How to handle muted issues. See Muting Rules below for details.
- account_
id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations_
enabled bool DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled bool
Whether workflow is enabled. Defaults to true.
- enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments_
enabled bool Whether enrichments are enabled. Defaults to true.
- name str
The name of the workflow.
- destinations List<Property Map>
Notification configuration. See Nested destination blocks below for details.
- issues
Filter Property Map A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- muting
Rules StringHandling How to handle muted issues. See Muting Rules below for details.
- account
Id Number Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations
Enabled Boolean DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled Boolean
Whether workflow is enabled. Defaults to true.
- enrichments Property Map
Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments
Enabled Boolean Whether enrichments are enabled. Defaults to true.
- name String
The name of the workflow.
Outputs
All input properties are implicitly available as output properties. Additionally, the Workflow resource produces the following output properties:
- Guid string
Workflow entity GUID
- Id string
The provider-assigned unique ID for this managed resource.
- Last
Run string The last time notification was sent for this workflow.
- Workflow
Id string The id of the workflow.
- Guid string
Workflow entity GUID
- Id string
The provider-assigned unique ID for this managed resource.
- Last
Run string The last time notification was sent for this workflow.
- Workflow
Id string The id of the workflow.
- guid String
Workflow entity GUID
- id String
The provider-assigned unique ID for this managed resource.
- last
Run String The last time notification was sent for this workflow.
- workflow
Id String The id of the workflow.
- guid string
Workflow entity GUID
- id string
The provider-assigned unique ID for this managed resource.
- last
Run string The last time notification was sent for this workflow.
- workflow
Id string The id of the workflow.
- guid str
Workflow entity GUID
- id str
The provider-assigned unique ID for this managed resource.
- last_
run str The last time notification was sent for this workflow.
- workflow_
id str The id of the workflow.
- guid String
Workflow entity GUID
- id String
The provider-assigned unique ID for this managed resource.
- last
Run String The last time notification was sent for this workflow.
- workflow
Id String The id of the workflow.
Look up Existing Workflow Resource
Get an existing Workflow 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?: WorkflowState, opts?: CustomResourceOptions): Workflow
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
destinations: Optional[Sequence[WorkflowDestinationArgs]] = None,
destinations_enabled: Optional[bool] = None,
enabled: Optional[bool] = None,
enrichments: Optional[WorkflowEnrichmentsArgs] = None,
enrichments_enabled: Optional[bool] = None,
guid: Optional[str] = None,
issues_filter: Optional[WorkflowIssuesFilterArgs] = None,
last_run: Optional[str] = None,
muting_rules_handling: Optional[str] = None,
name: Optional[str] = None,
workflow_id: Optional[str] = None) -> Workflow
func GetWorkflow(ctx *Context, name string, id IDInput, state *WorkflowState, opts ...ResourceOption) (*Workflow, error)
public static Workflow Get(string name, Input<string> id, WorkflowState? state, CustomResourceOptions? opts = null)
public static Workflow get(String name, Output<String> id, WorkflowState 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 int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- Destinations
List<Pulumi.
New Relic. Inputs. Workflow Destination Args> Notification configuration. See Nested destination blocks below for details.
- Destinations
Enabled bool DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- Enabled bool
Whether workflow is enabled. Defaults to true.
- Enrichments
Pulumi.
New Relic. Inputs. Workflow Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- Enrichments
Enabled bool Whether enrichments are enabled. Defaults to true.
- Guid string
Workflow entity GUID
- Issues
Filter Pulumi.New Relic. Inputs. Workflow Issues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- Last
Run string The last time notification was sent for this workflow.
- Muting
Rules stringHandling How to handle muted issues. See Muting Rules below for details.
- Name string
The name of the workflow.
- Workflow
Id string The id of the workflow.
- Account
Id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- Destinations
[]Workflow
Destination Args Notification configuration. See Nested destination blocks below for details.
- Destinations
Enabled bool DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- Enabled bool
Whether workflow is enabled. Defaults to true.
- Enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- Enrichments
Enabled bool Whether enrichments are enabled. Defaults to true.
- Guid string
Workflow entity GUID
- Issues
Filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- Last
Run string The last time notification was sent for this workflow.
- Muting
Rules stringHandling How to handle muted issues. See Muting Rules below for details.
- Name string
The name of the workflow.
- Workflow
Id string The id of the workflow.
- account
Id Integer Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations
List<Workflow
Destination Args> Notification configuration. See Nested destination blocks below for details.
- destinations
Enabled Boolean DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled Boolean
Whether workflow is enabled. Defaults to true.
- enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments
Enabled Boolean Whether enrichments are enabled. Defaults to true.
- guid String
Workflow entity GUID
- issues
Filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- last
Run String The last time notification was sent for this workflow.
- muting
Rules StringHandling How to handle muted issues. See Muting Rules below for details.
- name String
The name of the workflow.
- workflow
Id String The id of the workflow.
- account
Id number Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations
Workflow
Destination Args[] Notification configuration. See Nested destination blocks below for details.
- destinations
Enabled boolean DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled boolean
Whether workflow is enabled. Defaults to true.
- enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments
Enabled boolean Whether enrichments are enabled. Defaults to true.
- guid string
Workflow entity GUID
- issues
Filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- last
Run string The last time notification was sent for this workflow.
- muting
Rules stringHandling How to handle muted issues. See Muting Rules below for details.
- name string
The name of the workflow.
- workflow
Id string The id of the workflow.
- account_
id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations
Sequence[Workflow
Destination Args] Notification configuration. See Nested destination blocks below for details.
- destinations_
enabled bool DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled bool
Whether workflow is enabled. Defaults to true.
- enrichments
Workflow
Enrichments Args Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments_
enabled bool Whether enrichments are enabled. Defaults to true.
- guid str
Workflow entity GUID
- issues_
filter WorkflowIssues Filter Args A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- last_
run str The last time notification was sent for this workflow.
- muting_
rules_ strhandling How to handle muted issues. See Muting Rules below for details.
- name str
The name of the workflow.
- workflow_
id str The id of the workflow.
- account
Id Number Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- destinations List<Property Map>
Notification configuration. See Nested destination blocks below for details.
- destinations
Enabled Boolean DEPRECATED Whether destinations are enabled. Please use
enabled
instead: these two are different flags, but they are functionally identical. Defaults to true.Please use 'enabled' instead
- enabled Boolean
Whether workflow is enabled. Defaults to true.
- enrichments Property Map
Workflow's enrichments. See Nested enrichments blocks below for details.
- enrichments
Enabled Boolean Whether enrichments are enabled. Defaults to true.
- guid String
Workflow entity GUID
- issues
Filter Property Map A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
- last
Run String The last time notification was sent for this workflow.
- muting
Rules StringHandling How to handle muted issues. See Muting Rules below for details.
- name String
The name of the workflow.
- workflow
Id String The id of the workflow.
Supporting Types
WorkflowDestination
- Channel
Id string Id of a notification_channel to use for notifications. Please note that you have to use a notification channel, not an
alert_channel
.- Name string
The name of the workflow.
- Notification
Triggers List<string> Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
- Type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- Channel
Id string Id of a notification_channel to use for notifications. Please note that you have to use a notification channel, not an
alert_channel
.- Name string
The name of the workflow.
- Notification
Triggers []string Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
- Type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- channel
Id String Id of a notification_channel to use for notifications. Please note that you have to use a notification channel, not an
alert_channel
.- name String
The name of the workflow.
- notification
Triggers List<String> Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
- type String
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- channel
Id string Id of a notification_channel to use for notifications. Please note that you have to use a notification channel, not an
alert_channel
.- name string
The name of the workflow.
- notification
Triggers string[] Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
- type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- channel_
id str Id of a notification_channel to use for notifications. Please note that you have to use a notification channel, not an
alert_channel
.- name str
The name of the workflow.
- notification_
triggers Sequence[str] Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
- type str
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- channel
Id String Id of a notification_channel to use for notifications. Please note that you have to use a notification channel, not an
alert_channel
.- name String
The name of the workflow.
- notification
Triggers List<String> Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
- type String
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
WorkflowEnrichments
- Nrqls
List<Pulumi.
New Relic. Inputs. Workflow Enrichments Nrql> a wrapper block
- Nrqls
[]Workflow
Enrichments Nrql a wrapper block
- nrqls
List<Workflow
Enrichments Nrql> a wrapper block
- nrqls
Workflow
Enrichments Nrql[] a wrapper block
- nrqls
Sequence[Workflow
Enrichments Nrql] a wrapper block
- nrqls List<Property Map>
a wrapper block
WorkflowEnrichmentsNrql
- Configurations
List<Pulumi.
New Relic. Inputs. Workflow Enrichments Nrql Configuration> Another wrapper block
- Name string
The name of the workflow.
- Account
Id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- Enrichment
Id string - Type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- Configurations
[]Workflow
Enrichments Nrql Configuration Another wrapper block
- Name string
The name of the workflow.
- Account
Id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- Enrichment
Id string - Type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- configurations
List<Workflow
Enrichments Nrql Configuration> Another wrapper block
- name String
The name of the workflow.
- account
Id Integer Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- enrichment
Id String - type String
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- configurations
Workflow
Enrichments Nrql Configuration[] Another wrapper block
- name string
The name of the workflow.
- account
Id number Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- enrichment
Id string - type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- configurations
Sequence[Workflow
Enrichments Nrql Configuration] Another wrapper block
- name str
The name of the workflow.
- account_
id int Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- enrichment_
id str - type str
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
- configurations List<Property Map>
Another wrapper block
- name String
The name of the workflow.
- account
Id Number Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
- enrichment
Id String - type String
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.
WorkflowEnrichmentsNrqlConfiguration
- Query string
An NRQL query to run
- Query string
An NRQL query to run
- query String
An NRQL query to run
- query string
An NRQL query to run
- query str
An NRQL query to run
- query String
An NRQL query to run
WorkflowIssuesFilter
- Name string
The name of the workflow.
- Type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.- Filter
Id string - Predicates
List<Pulumi.
New Relic. Inputs. Workflow Issues Filter Predicate> A condition an issue event should satisfy to be processed by the workflow
- Name string
The name of the workflow.
- Type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.- Filter
Id string - Predicates
[]Workflow
Issues Filter Predicate A condition an issue event should satisfy to be processed by the workflow
- name String
The name of the workflow.
- type String
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.- filter
Id String - predicates
List<Workflow
Issues Filter Predicate> A condition an issue event should satisfy to be processed by the workflow
- name string
The name of the workflow.
- type string
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.- filter
Id string - predicates
Workflow
Issues Filter Predicate[] A condition an issue event should satisfy to be processed by the workflow
- name str
The name of the workflow.
- type str
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.- filter_
id str - predicates
Sequence[Workflow
Issues Filter Predicate] A condition an issue event should satisfy to be processed by the workflow
- name String
The name of the workflow.
- type String
Type of the filter. Please just set this field to
FILTER
. The field is likely to be deprecated/removed in the near future.- filter
Id String - predicates List<Property Map>
A condition an issue event should satisfy to be processed by the workflow
WorkflowIssuesFilterPredicate
Import
Workflows can be imported using the id
, e.g. bash
$ pulumi import newrelic:index/workflow:Workflow foo <id>
You can find the workflow ID from the workflow table by clicking on … at the end of the row and choosing Copy workflow id to clipboard
.
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
newrelic
Terraform Provider.