github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/datadog/r/monitor.html.markdown (about) 1 --- 2 layout: "datadog" 3 page_title: "Datadog: datadog_monitor" 4 sidebar_current: "docs-datadog-resource-monitor" 5 description: |- 6 Provides a Datadog monitor resource. This can be used to create and manage monitors. 7 --- 8 9 # datadog\_monitor 10 11 Provides a Datadog monitor resource. This can be used to create and manage Datadog monitors. 12 13 ## Example Usage 14 15 ``` 16 # Create a new Datadog monitor 17 resource "datadog_monitor" "foo" { 18 name = "Name for monitor foo" 19 type = "metric alert" 20 message = "Monitor triggered. Notify: @hipchat-channel" 21 escalation_message = "Escalation message @pagerduty" 22 23 query = "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo} by {host} > 2" 24 25 thresholds { 26 ok = 0 27 warning = 1 28 critical = 2 29 } 30 31 notify_no_data = false 32 renotify_interval = 60 33 34 notify_audit = false 35 timeout_h = 60 36 include_tags = true 37 silenced { 38 "*" = 0 39 } 40 tags { 41 "foo" = "bar" 42 "bar" = "baz" 43 } 44 } 45 ``` 46 47 ## Argument Reference 48 49 The following arguments are supported: 50 51 * `type` - (Required) The type of the monitor, chosen from: 52 * `metric alert` 53 * `service check` 54 * `event alert` 55 * `query alert` 56 * `name` - (Required) Name of Datadog monitor 57 * `query` - (Required) The monitor query to notify on with syntax varying depending on what type of monitor 58 you are creating. See [API Reference](http://docs.datadoghq.com/api) for options. 59 * `message` - (Required) A message to include with notifications for this monitor. 60 Email notifications can be sent to specific users by using the same '@username' notation as events. 61 * `escalation_message` - (Optional) A message to include with a re-notification. Supports the '@username' 62 notification allowed elsewhere. 63 * `thresholds` - (Required) Thresholds by threshold type: 64 * `ok` 65 * `warning` 66 * `critical` 67 * `notify_no_data` (Optional) A boolean indicating whether this monitor will notify when data stops reporting. Defaults 68 to true. 69 * `no_data_timeframe` (Optional) The number of minutes before a monitor will notify when data stops reporting. Must be at 70 least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for 71 metric alerts, 2 minutes for service checks. 72 * `renotify_interval` (Optional) The number of minutes after the last notification before a monitor will re-notify 73 on the current status. It will only re-notify if it's not resolved. 74 * `notify_audit` (Optional) A boolean indicating whether tagged users will be notified on changes to this monitor. 75 Defaults to false. 76 * `timeout_h` (Optional) The number of hours of the monitor not reporting data before it will automatically resolve 77 from a triggered state. Defaults to false. 78 * `include_tags` (Optional) A boolean indicating whether notifications from this monitor will automatically insert its 79 triggering tags into the title. Defaults to true. 80 * `silenced` (Optional) Each scope will be muted until the given POSIX timestamp or forever if the value is 0. 81 * `require_full_window` (Optional) A boolean indicating whether this monitor needs a full window of data before it's evaluated. 82 We highly recommend you set this to False for sparse metrics, otherwise some evaluations will be skipped. 83 Default: True for "on average", "at all times" and "in total" aggregation. False otherwise. 84 * `locked` (Optional) A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False. 85 * `tags` (Optional) A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it's not currently possible to filter by these tags when querying via the API 86 87 To mute the alert completely: 88 89 silenced { 90 '*' = 0 91 } 92 93 To mute role:db for a short time: 94 95 silenced { 96 'role:db' = 1412798116 97 } 98 99 ## Attributes Reference 100 101 The following attributes are exported: 102 103 * `id` - ID of the Datadog monitor 104 105 ## Import 106 107 Monitors can be imported using their numeric ID, e.g. 108 109 ``` 110 $ terraform import datadog_monitor.bytes_received_localhost 2081 111 ```