github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/newrelic/index.html.markdown (about) 1 --- 2 layout: "newrelic" 3 page_title: "Provider: New Relic" 4 sidebar_current: "docs-newrelic-index" 5 description: |- 6 New Relic offers a performance management solution enabling developers to 7 diagnose and fix application performance problems in real time. 8 --- 9 10 # New Relic Provider 11 12 [New Relic](https://newrelic.com/) offers a performance management solution 13 enabling developers to diagnose and fix application performance problems in real time. 14 15 Use the navigation to the left to read about the available resources. 16 17 ## Example Usage 18 19 ``` 20 # Configure the New Relic provider 21 provider "newrelic" { 22 api_key = "${var.newrelic_api_key}" 23 } 24 25 # Create an alert policy 26 resource "newrelic_alert_policy" "alert" { 27 name = "Alert" 28 } 29 30 # Add a condition 31 resource "newrelic_alert_condition" "foo" { 32 policy_id = "${newrelic_alert_policy.alert.id}" 33 34 name = "foo" 35 type = "apm_app_metric" 36 entities = ["12345"] # You can look this up in New Relic 37 metric = "apdex" 38 runbook_url = "https://docs.example.com/my-runbook" 39 40 term { 41 duration = 5 42 operator = "below" 43 priority = "critical" 44 threshold = "0.75" 45 time_function = "all" 46 } 47 } 48 49 # Add a notification channel 50 resource "newrelic_alert_channel" "email" { 51 name = "email" 52 type = "email" 53 54 configuration = { 55 recipients = "paul@example.com" 56 include_json_attachment = "1" 57 } 58 } 59 60 # Link the channel to the policy 61 resource "newrelic_alert_policy_channel" "alert_email" { 62 policy_id = "${newrelic_alert_policy.alert.id}" 63 channel_id = "${newrelic_alert_channel.email.id}" 64 } 65 ``` 66 67 ## Argument Reference 68 69 The following arguments are supported: 70 71 * `api_key` - (Required) Your New Relic API key.