github.com/simonswine/terraform@v0.9.0-beta2/website/source/docs/providers/newrelic/r/alert_condition.html.markdown (about) 1 --- 2 layout: "newrelic" 3 page_title: "New Relic: newrelic_alert_condition" 4 sidebar_current: "docs-newrelic-resource-alert-condition" 5 description: |- 6 Create and manage an alert condition for a policy in New Relic. 7 --- 8 9 # newrelic\_alert\_condition 10 11 ## Example Usage 12 13 ``` 14 data "newrelic_application" "app" { 15 name = "my-app" 16 } 17 18 resource "newrelic_alert_policy" "foo" { 19 name = "foo" 20 } 21 22 resource "newrelic_alert_condition" "foo" { 23 policy_id = "${newrelic_alert_policy.foo.id}" 24 25 name = "foo" 26 type = "apm_app_metric" 27 entities = ["${data.newrelic_application.app.id}"] 28 metric = "apdex" 29 runbook_url = "https://www.example.com" 30 31 term { 32 duration = 5 33 operator = "below" 34 priority = "critical" 35 threshold = "0.75" 36 time_function = "all" 37 } 38 } 39 ``` 40 41 ## Argument Reference 42 43 The following arguments are supported: 44 45 * `policy_id` - (Required) The ID of the policy where this condition should be used. 46 * `name` - (Required) The title of the condition 47 * `type` - (Required) The type of condition. One of: `apm_app_metric`, `apm_kt_metric`, `servers_metric`, `browser_metric`, `mobile_metric` 48 * `entities` - (Required) The instance IDS associated with this condition. 49 * `metric` - (Required) The metric field accepts parameters based on the `type` set. 50 * `runbook_url` - (Optional) Runbook URL to display in notifications. 51 * `term` - (Required) A list of terms for this condition. See [Terms](#terms) below for details. 52 * `user_defined_metric` - (Optional) A custom metric to be evaluated. 53 * `user_defined_value_function` - (Optional) One of: `average`, `min`, `max`, `total`, or `sample_size`. 54 55 ## Terms 56 57 The `term` mapping supports the following arguments: 58 59 * `duration` - (Required) In minutes, must be: `5`, `10`, `15`, `30`, `60`, or `120`. 60 * `operator` - (Optional) `above`, `below`, or `equal`. Defaults to `equal`. 61 * `priority` - (Optional) `critical` or `warning`. Defaults to `critical`. 62 * `threshold` - (Required) Must be 0 or greater. 63 * `time_function` - (Required) `all` or `any`. 64 65 ## Attributes Reference 66 67 The following attributes are exported: 68 69 * `id` - The ID of the alert condition. 70 71 ## Import 72 73 Alert conditions can be imported using the `id`, e.g. 74 75 ``` 76 $ terraform import newrelic_alert_condition.main 12345 77 ```