github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/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  }
    41  ```
    42  
    43  ## Argument Reference
    44  
    45  The following arguments are supported:
    46  
    47  * `type` - (Required) The type of the monitor, chosen from:
    48      * `metric alert`
    49      * `service check`
    50      * `event alert`
    51      * `query alert`
    52  * `name` - (Required) Name of Datadog monitor
    53  * `query` - (Required) The monitor query to notify on with syntax varying depending on what type of monitor
    54      you are creating. See [API Reference](http://docs.datadoghq.com/api) for options.
    55  * `message` - (Required) A message to include with notifications for this monitor.
    56      Email notifications can be sent to specific users by using the same '@username' notation as events.
    57  * `escalation_message` - (Optional) A message to include with a re-notification. Supports the '@username'
    58      notification allowed elsewhere.
    59  * `thresholds` - (Required) Thresholds by threshold type:
    60      * `ok`
    61      * `warning`
    62      * `critical`
    63  * `notify_no_data` (Optional) A boolean indicating whether this monitor will notify when data stops reporting. Defaults
    64      to false.
    65  * `no_data_timeframe` (Optional) The number of minutes before a monitor will notify when data stops reporting. Must be at
    66      least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for
    67      metric alerts, 2 minutes for service checks.
    68  * `renotify_interval` (Optional) The number of minutes after the last notification before a monitor will re-notify
    69      on the current status. It will only re-notify if it's not resolved.
    70  * `notify_audit` (Optional) A boolean indicating whether tagged users will be notified on changes to this monitor. 
    71      Defaults to false.
    72  * `timeout_h` (Optional) The number of hours of the monitor not reporting data before it will automatically resolve
    73      from a triggered state. Defaults to false.
    74  * `include_tags` (Optional) A boolean indicating whether notifications from this monitor will automatically insert its
    75      triggering tags into the title. Defaults to true.
    76  * `silenced` (Optional) Each scope will be muted until the given POSIX timestamp or forever if the value is 0.
    77      
    78      To mute the alert completely:
    79      
    80          silenced {
    81            '*' =  0
    82          }
    83            
    84      To mute role:db for a short time:
    85      
    86          silenced {
    87            'role:db' = 1412798116
    88          }
    89  
    90  ## Attributes Reference
    91  
    92  The following attributes are exported:
    93  
    94  * `id` - ID of the Datadog monitor