import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Use this resource to create and manage New Relic workflows. * * ## Example Usage * * ##### Workflow * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const foo = new newrelic.Workflow("foo", { * name: "workflow-example", * mutingRulesHandling: "NOTIFY_ALL_ISSUES", * issuesFilter: { * name: "filter-name", * type: "FILTER", * predicates: [{ * attribute: "accumulations.tag.team", * operator: "EXACTLY_MATCHES", * values: ["growth"], * }], * }, * destinations: [{ * channelId: someChannel.id, * }], * }); * ``` * * ## Policy-Based Workflow Example * * This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles * * ```typescript * 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", {name: "my_policy"}); * // Create a reusable notification destination * const webhook_destination = new newrelic.NotificationDestination("webhook-destination", { * name: "destination-webhook", * 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", { * name: "channel-webhook", * 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", { * name: "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, * }], * }); * ``` * * ### An example of a workflow with enrichments * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const workflow_example = new newrelic.Workflow("workflow-example", { * name: "workflow-enrichment-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: webhook_channel.id, * }], * }); * ``` * * ### An example of a workflow with notification triggers * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const workflow_example = new newrelic.Workflow("workflow-example", { * name: "workflow-enrichment-example", * mutingRulesHandling: "NOTIFY_ALL_ISSUES", * issuesFilter: { * name: "Filter-name", * type: "FILTER", * predicates: [{ * attribute: "accumulations.tag.team", * operator: "EXACTLY_MATCHES", * values: ["my_team"], * }], * }, * destinations: [{ * channelId: webhook_channel.id, * notificationTriggers: ["ACTIVATED"], * }], * }); * ``` * * ## Additional Information * * More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/). * * ### Moving from Legacy Alert Policy Channels to Workflows * As described in the documentation of this resource, mapping alert channels (created using `newrelic.NotificationDestination` and `newrelic.NotificationChannel`) to policies can be performed using the `newrelic.Workflow` resource, which is an alternative to the legacy resource `newrelic.AlertPolicyChannel` (which consumes alert channels created using the legacy resource `newrelic.AlertChannel`). * * Both of the legacy resources mentioned above, `newrelic.AlertChannel` and `newrelic.AlertPolicyChannel` are **deprecated** and will be **removed in a future major release**, as stated in the documentation of both of these resources. * * If you're currently using `newrelic.AlertChannel` and `newrelic.AlertPolicyChannel` to manage alert channels linked to policies, we **strongly recommend** migrating to these workflows and notifications-based resources at the earliest. * * Please refer to the examples in this page, or this example for illustrations on setting up channels and workflows with these resources. * * ## v3.3 changes * * In version v3.3 we renamed the following arguments: * * - `workflowEnabled` changed to `enabled`. * - `destinationConfiguration` changed to `destination`. * - `predicates` changed to `predicate`. * - Enrichment's `configurations` changed to `configuration`. * * ## Import * * Workflows can be imported using the `id`, e.g. * * ```sh * $ pulumi import newrelic:index/workflow:Workflow foo * ``` * 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`. */ export declare class Workflow extends pulumi.CustomResource { /** * Get an existing Workflow resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: WorkflowState, opts?: pulumi.CustomResourceOptions): Workflow; /** * Returns true if the given object is an instance of Workflow. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Workflow; /** * Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section. */ readonly accountId: pulumi.Output; /** * Notification configuration. See Nested destination blocks below for details. */ readonly destinations: pulumi.Output; /** * **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead: * these two are different flags, but they are functionally identical. Defaults to true. * * @deprecated Please use 'enabled' instead */ readonly destinationsEnabled: pulumi.Output; /** * Whether workflow is enabled. Defaults to true. */ readonly enabled: pulumi.Output; /** * Workflow's enrichments. See Nested enrichments blocks below for details. */ readonly enrichments: pulumi.Output; /** * Whether enrichments are enabled. Defaults to true. */ readonly enrichmentsEnabled: pulumi.Output; /** * Workflow entity GUID */ readonly guid: pulumi.Output; /** * A filter used to identify issues handled by this workflow. See Nested issuesFilter blocks below for details. */ readonly issuesFilter: pulumi.Output; /** * The last time notification was sent for this workflow. */ readonly lastRun: pulumi.Output; /** * How to handle muted issues. See Muting Rules below for details. */ readonly mutingRulesHandling: pulumi.Output; /** * The name of the workflow. */ readonly name: pulumi.Output; /** * The id of the workflow. */ readonly workflowId: pulumi.Output; /** * Create a Workflow resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: WorkflowArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Workflow resources. */ export interface WorkflowState { /** * Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section. */ accountId?: pulumi.Input; /** * Notification configuration. See Nested destination blocks below for details. */ destinations?: pulumi.Input[] | undefined>; /** * **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead: * these two are different flags, but they are functionally identical. Defaults to true. * * @deprecated Please use 'enabled' instead */ destinationsEnabled?: pulumi.Input; /** * Whether workflow is enabled. Defaults to true. */ enabled?: pulumi.Input; /** * Workflow's enrichments. See Nested enrichments blocks below for details. */ enrichments?: pulumi.Input; /** * Whether enrichments are enabled. Defaults to true. */ enrichmentsEnabled?: pulumi.Input; /** * Workflow entity GUID */ guid?: pulumi.Input; /** * A filter used to identify issues handled by this workflow. See Nested issuesFilter blocks below for details. */ issuesFilter?: pulumi.Input; /** * The last time notification was sent for this workflow. */ lastRun?: pulumi.Input; /** * How to handle muted issues. See Muting Rules below for details. */ mutingRulesHandling?: pulumi.Input; /** * The name of the workflow. */ name?: pulumi.Input; /** * The id of the workflow. */ workflowId?: pulumi.Input; } /** * The set of arguments for constructing a Workflow resource. */ export interface WorkflowArgs { /** * Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section. */ accountId?: pulumi.Input; /** * Notification configuration. See Nested destination blocks below for details. */ destinations: pulumi.Input[]>; /** * **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead: * these two are different flags, but they are functionally identical. Defaults to true. * * @deprecated Please use 'enabled' instead */ destinationsEnabled?: pulumi.Input; /** * Whether workflow is enabled. Defaults to true. */ enabled?: pulumi.Input; /** * Workflow's enrichments. See Nested enrichments blocks below for details. */ enrichments?: pulumi.Input; /** * Whether enrichments are enabled. Defaults to true. */ enrichmentsEnabled?: pulumi.Input; /** * A filter used to identify issues handled by this workflow. See Nested issuesFilter blocks below for details. */ issuesFilter: pulumi.Input; /** * How to handle muted issues. See Muting Rules below for details. */ mutingRulesHandling: pulumi.Input; /** * The name of the workflow. */ name?: pulumi.Input; } //# sourceMappingURL=workflow.d.ts.map