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 alert conditions for APM, Browser, and Mobile in New Relic. * * > **WARNING:** The `newrelic.AlertCondition` resource is deprecated and will be removed in the next major release. The resource newrelic.NrqlAlertCondition would be a preferred alternative to configure alert conditions - in most cases, feature parity can be achieved with a NRQL query. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const app = newrelic.getEntity({ * name: "my-app", * type: "APPLICATION", * domain: "APM", * }); * const foo = new newrelic.AlertPolicy("foo", {name: "foo"}); * const fooAlertCondition = new newrelic.AlertCondition("foo", { * policyId: foo.id, * name: "foo", * type: "apm_app_metric", * entities: [app.then(app => app.applicationId)], * metric: "apdex", * runbookUrl: "https://www.example.com", * conditionScope: "application", * terms: [{ * duration: 5, * operator: "below", * priority: "critical", * threshold: 0.75, * timeFunction: "all", * }], * }); * ``` * * ## Terms * * The `term` mapping supports the following arguments: * * * `duration` - (Required) In minutes, must be in the range of `5` to `120`, inclusive. * * `operator` - (Optional) `above`, `below`, or `equal`. Defaults to `equal`. * * `priority` - (Optional) `critical` or `warning`. Defaults to `critical`. Terms must include at least one `critical` priority term * * `threshold` - (Required) Must be 0 or greater. * * `timeFunction` - (Required) `all` or `any`. * * ## Tags * * Manage alert condition tags with `newrelic.EntityTags`. For up-to-date documentation about the tagging resource, please check newrelic.EntityTags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const foo = newrelic.getEntity({ * name: "foo entitiy", * }); * const fooAlertPolicy = new newrelic.AlertPolicy("foo", {name: "foo policy"}); * const fooAlertCondition = new newrelic.AlertCondition("foo", { * policyId: fooAlertPolicy.id, * name: "foo condition", * type: "apm_app_metric", * entities: [foo.then(foo => foo.applicationId)], * metric: "apdex", * runbookUrl: "https://www.example.com", * conditionScope: "application", * terms: [{ * duration: 5, * operator: "below", * priority: "critical", * threshold: 0.75, * timeFunction: "all", * }], * }); * const myConditionEntityTags = new newrelic.EntityTags("my_condition_entity_tags", { * guid: fooAlertCondition.entityGuid, * tags: [ * { * key: "my-key", * values: [ * "my-value", * "my-other-value", * ], * }, * { * key: "my-key-2", * values: ["my-value-2"], * }, * ], * }); * ``` * * ## Import * * Alert conditions can be imported using notation `alert_policy_id:alert_condition_id`, e.g. * * ```sh * $ pulumi import newrelic:index/alertCondition:AlertCondition main 123456:6789012345 * ``` */ export declare class AlertCondition extends pulumi.CustomResource { /** * Get an existing AlertCondition 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?: AlertConditionState, opts?: pulumi.CustomResourceOptions): AlertCondition; /** * Returns true if the given object is an instance of AlertCondition. 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 AlertCondition; /** * `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances). */ readonly conditionScope: pulumi.Output; /** * Whether the condition is enabled or not. Defaults to true. */ readonly enabled: pulumi.Output; /** * The instance IDs associated with this condition. */ readonly entities: pulumi.Output; /** * The unique entity identifier of the condition in New Relic. */ readonly entityGuid: pulumi.Output; /** * A valid Garbage Collection metric e.g. `GC/G1 Young Generation`. */ readonly gcMetric: pulumi.Output; /** * The metric field accepts parameters based on the `type` set. One of these metrics based on `type`: */ readonly metric: pulumi.Output; /** * The title of the condition. Must be between 1 and 64 characters, inclusive. */ readonly name: pulumi.Output; /** * The ID of the policy where this condition should be used. */ readonly policyId: pulumi.Output; /** * Runbook URL to display in notifications. */ readonly runbookUrl: pulumi.Output; /** * A list of terms for this condition. See Terms below for details. */ readonly terms: pulumi.Output; /** * The type of condition. One of: `apmAppMetric`, `apmJvmMetric`, `apmKtMetric`, `browserMetric`, `mobileMetric` */ readonly type: pulumi.Output; /** * A custom metric to be evaluated. */ readonly userDefinedMetric: pulumi.Output; /** * One of: `average`, `min`, `max`, `total`, `sampleSize`, `rate` or `percent`. * * > **NOTE:** The `userDefinedValueFunction` can have `rate` or `percent` only when the `type` is `mobileMetric`. * * ``` * Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID. * ``` */ readonly userDefinedValueFunction: pulumi.Output; /** * Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift: * * when `type` = `apmAppMetric` and `conditionScope` = `instance` * * when `type` = `apmJvmMetric` */ readonly violationCloseTimer: pulumi.Output; /** * Create a AlertCondition 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: AlertConditionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AlertCondition resources. */ export interface AlertConditionState { /** * `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances). */ conditionScope?: pulumi.Input; /** * Whether the condition is enabled or not. Defaults to true. */ enabled?: pulumi.Input; /** * The instance IDs associated with this condition. */ entities?: pulumi.Input[] | undefined>; /** * The unique entity identifier of the condition in New Relic. */ entityGuid?: pulumi.Input; /** * A valid Garbage Collection metric e.g. `GC/G1 Young Generation`. */ gcMetric?: pulumi.Input; /** * The metric field accepts parameters based on the `type` set. One of these metrics based on `type`: */ metric?: pulumi.Input; /** * The title of the condition. Must be between 1 and 64 characters, inclusive. */ name?: pulumi.Input; /** * The ID of the policy where this condition should be used. */ policyId?: pulumi.Input; /** * Runbook URL to display in notifications. */ runbookUrl?: pulumi.Input; /** * A list of terms for this condition. See Terms below for details. */ terms?: pulumi.Input[] | undefined>; /** * The type of condition. One of: `apmAppMetric`, `apmJvmMetric`, `apmKtMetric`, `browserMetric`, `mobileMetric` */ type?: pulumi.Input; /** * A custom metric to be evaluated. */ userDefinedMetric?: pulumi.Input; /** * One of: `average`, `min`, `max`, `total`, `sampleSize`, `rate` or `percent`. * * > **NOTE:** The `userDefinedValueFunction` can have `rate` or `percent` only when the `type` is `mobileMetric`. * * ``` * Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID. * ``` */ userDefinedValueFunction?: pulumi.Input; /** * Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift: * * when `type` = `apmAppMetric` and `conditionScope` = `instance` * * when `type` = `apmJvmMetric` */ violationCloseTimer?: pulumi.Input; } /** * The set of arguments for constructing a AlertCondition resource. */ export interface AlertConditionArgs { /** * `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances). */ conditionScope?: pulumi.Input; /** * Whether the condition is enabled or not. Defaults to true. */ enabled?: pulumi.Input; /** * The instance IDs associated with this condition. */ entities: pulumi.Input[]>; /** * A valid Garbage Collection metric e.g. `GC/G1 Young Generation`. */ gcMetric?: pulumi.Input; /** * The metric field accepts parameters based on the `type` set. One of these metrics based on `type`: */ metric: pulumi.Input; /** * The title of the condition. Must be between 1 and 64 characters, inclusive. */ name?: pulumi.Input; /** * The ID of the policy where this condition should be used. */ policyId: pulumi.Input; /** * Runbook URL to display in notifications. */ runbookUrl?: pulumi.Input; /** * A list of terms for this condition. See Terms below for details. */ terms: pulumi.Input[]>; /** * The type of condition. One of: `apmAppMetric`, `apmJvmMetric`, `apmKtMetric`, `browserMetric`, `mobileMetric` */ type: pulumi.Input; /** * A custom metric to be evaluated. */ userDefinedMetric?: pulumi.Input; /** * One of: `average`, `min`, `max`, `total`, `sampleSize`, `rate` or `percent`. * * > **NOTE:** The `userDefinedValueFunction` can have `rate` or `percent` only when the `type` is `mobileMetric`. * * ``` * Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID. * ``` */ userDefinedValueFunction?: pulumi.Input; /** * Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift: * * when `type` = `apmAppMetric` and `conditionScope` = `instance` * * when `type` = `apmJvmMetric` */ violationCloseTimer?: pulumi.Input; } //# sourceMappingURL=alertCondition.d.ts.map