|
| 1 | +# Grafana Contact Point |
| 2 | + |
| 3 | +Provides a Logz.io Grafana Contact Point resource. This can be used to create and manage Logz.io Grafana Contact Points. |
| 4 | + |
| 5 | +* Learn more about grafana contact points in the [Logz.io Docs](https://docs.logz.io/api/#tag/Grafana-contact-points). |
| 6 | + |
| 7 | +## Example Usage |
| 8 | + |
| 9 | +```hcl |
| 10 | +variable "api_token" { |
| 11 | + type = string |
| 12 | + description = "your logzio API token" |
| 13 | +} |
| 14 | +
|
| 15 | +provider "logzio" { |
| 16 | + api_token = var.api_token |
| 17 | +} |
| 18 | +
|
| 19 | +resource "logzio_grafana_contact_point" "test_cp_email" { |
| 20 | + name = "my-email-cp" |
| 21 | + email { |
| 22 | + addresses = ["example@example.com", "example2@example.com"] |
| 23 | + disable_resolve_message = false |
| 24 | + single_email = true |
| 25 | + message = "{{ len .Alerts.Firing }} firing." |
| 26 | + } |
| 27 | +} |
| 28 | +
|
| 29 | +resource "logzio_grafana_contact_point" "test_cp_googlechat" { |
| 30 | + name = "my-googlechat-cp" |
| 31 | + googlechat { |
| 32 | + url = "some.url" |
| 33 | + disable_resolve_message = false |
| 34 | + message = "{{ len .Alerts.Firing }} firing." |
| 35 | + } |
| 36 | +} |
| 37 | +
|
| 38 | +resource "logzio_grafana_contact_point" "test_cp_opsgenie" { |
| 39 | + name = "my-opsgenie-cp" |
| 40 | + opsgenie { |
| 41 | + disable_resolve_message = false |
| 42 | + api_url = "some.url" |
| 43 | + api_key = "some_api_key" |
| 44 | + auto_close = false |
| 45 | + override_priority = true |
| 46 | + send_tags_as = "both" |
| 47 | + } |
| 48 | +} |
| 49 | +
|
| 50 | +resource "logzio_grafana_contact_point" "test_cp_pagerduty" { |
| 51 | + name = "my-pagerduty-cp" |
| 52 | + pagerduty { |
| 53 | + integration_key = "some-key" |
| 54 | + class = "some-class" |
| 55 | + component = "some-component" |
| 56 | + group = "some-group" |
| 57 | + severity = "info" |
| 58 | + disable_resolve_message = false |
| 59 | + } |
| 60 | +} |
| 61 | +
|
| 62 | +resource "logzio_grafana_contact_point" "test_cp_slack" { |
| 63 | + name = "my-slack-cp" |
| 64 | + slack { |
| 65 | + token = "some-token" |
| 66 | + title = "some-title" |
| 67 | + text = "{{ len .Alerts.Firing }} firing." |
| 68 | + mention_channel = "here" |
| 69 | + recipient = "me" |
| 70 | + disable_resolve_message = false |
| 71 | + } |
| 72 | +} |
| 73 | +
|
| 74 | +resource "logzio_grafana_contact_point" "test_cp_teams" { |
| 75 | + name = "my-teams-cp" |
| 76 | + teams { |
| 77 | + url = "url" |
| 78 | + message = "message" |
| 79 | + disable_resolve_message = false |
| 80 | + } |
| 81 | +} |
| 82 | +
|
| 83 | +resource "logzio_grafana_contact_point" "test_cp_victorops" { |
| 84 | + name = "my-victorops-cp" |
| 85 | + victorops { |
| 86 | + url = "url" |
| 87 | + message_type = "CRITICAL" |
| 88 | + disable_resolve_message = false |
| 89 | + } |
| 90 | +} |
| 91 | +
|
| 92 | +resource "logzio_grafana_contact_point" "test_cp_webhook" { |
| 93 | + name = "my-webhook-cp" |
| 94 | + webhook { |
| 95 | + url = "url" |
| 96 | + disable_resolve_message = false |
| 97 | + } |
| 98 | + opsgenie { |
| 99 | + disable_resolve_message = false |
| 100 | + api_url = "some.url" |
| 101 | + api_key = "some_api_key" |
| 102 | + auto_close = false |
| 103 | + override_priority = true |
| 104 | + send_tags_as = "both" |
| 105 | + } |
| 106 | +} |
| 107 | +
|
| 108 | +``` |
| 109 | + |
| 110 | +## Argument Reference |
| 111 | + |
| 112 | +### Required: |
| 113 | + |
| 114 | +* `name` - (String) The name of your contact point. |
| 115 | + |
| 116 | +### Optional: |
| 117 | + |
| 118 | +* `email` - (Block List) A contact point that sends notifications to an email address. See below for **nested schema**. |
| 119 | +* `googlechat` - (Block List) A contact point that sends notifications to Google Chat. See below for **nested schema**. |
| 120 | +* `opsgenie` - (Block List) A contact point that sends notifications to OpsGenie. See below for **nested schema**. |
| 121 | +* `pagerduty` - (Block List) A contact point that sends notifications to PagerDuty. See below for **nested schema**. |
| 122 | +* `slack` - (Block List) A contact point that sends notifications to Slack. See below for **nested schema**. |
| 123 | +* `teams` - (Block List) A contact point that sends notifications to Microsoft Teams. See below for **nested schema**. |
| 124 | +* `victorops` - (Block List) A contact point that sends notifications to VictorOps. See below for **nested schema**. |
| 125 | +* `webhook` - (Block List) A contact point that sends notifications to an arbitrary webhook. See below for **nested schema**. |
| 126 | + |
| 127 | +## Attribute Reference |
| 128 | + |
| 129 | +* `id` - (String) The ID of this resource. |
| 130 | + |
| 131 | +## Nested schema for `email`: |
| 132 | + |
| 133 | +### Argument Reference |
| 134 | + |
| 135 | +#### Required: |
| 136 | + |
| 137 | +* `addresses` - (List of String) The addresses to send emails to. |
| 138 | + |
| 139 | +#### Optional: |
| 140 | + |
| 141 | +* `single_email` - (Boolean) Whether to send a single email CC'ing all addresses, rather than a separate email to each address. Defaults to `false`. |
| 142 | +* `message` - (String) The templated content of the email. Defaults to ``. |
| 143 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 144 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 145 | + |
| 146 | +### Attribute Reference |
| 147 | + |
| 148 | +* `uid` - (String) The UID of the contact point. |
| 149 | + |
| 150 | +## Nested schema for `googlechat`: |
| 151 | + |
| 152 | +#### Required: |
| 153 | + |
| 154 | +* `url` - (String, Sensitive) The Google Chat webhook URL. |
| 155 | + |
| 156 | +#### Optional: |
| 157 | + |
| 158 | +* `message` - (String) The templated content of the message. |
| 159 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 160 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 161 | + |
| 162 | +### Attribute Reference |
| 163 | + |
| 164 | +* `uid` - (String) The UID of the contact point. |
| 165 | + |
| 166 | +## Nested schema for `opsgenie`: |
| 167 | + |
| 168 | +#### Required: |
| 169 | + |
| 170 | +* `api_key` - (String, Sensitive) The OpsGenie API key to use. |
| 171 | + |
| 172 | +#### Optional: |
| 173 | + |
| 174 | +* `api_url` - (String) Allows customization of the OpsGenie API URL. |
| 175 | +* `auto_close` - (Boolean) Whether to auto-close alerts in OpsGenie when they resolve in the Alertmanager. |
| 176 | +* `override_priority` - (Boolean) Whether to allow the alert priority to be configured via the value of the og_priority annotation on the alert. |
| 177 | +* `send_tags_as` - (String) Whether to send annotations to OpsGenie as Tags, Details, or both. Supported values are `tags`, `details`, `both`, or empty to use the default behavior of Tags. |
| 178 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 179 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 180 | + |
| 181 | +### Attribute Reference |
| 182 | + |
| 183 | +* `uid` - (String) The UID of the contact point. |
| 184 | + |
| 185 | +## Nested schema for `pagerduty`: |
| 186 | + |
| 187 | +#### Required: |
| 188 | + |
| 189 | +* `integration_key` - (String, Sensitive) The PagerDuty API key. |
| 190 | + |
| 191 | +#### Optional: |
| 192 | + |
| 193 | +* `class` - (String) The class or type of event. |
| 194 | +* `component` - (String) The component being affected by the event. |
| 195 | +* `group` - (String) The group to which the provided component belongs to. |
| 196 | +* `summary` - (String) The templated summary message of the event. |
| 197 | +* `severity` - (String) The PagerDuty event severity level. Can be one of `info`, `warning`, `error`, `critical`. |
| 198 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 199 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 200 | + |
| 201 | +### Attribute Reference |
| 202 | + |
| 203 | +* `uid` - (String) The UID of the contact point. |
| 204 | + |
| 205 | +## Nested schema for `slack`: |
| 206 | + |
| 207 | +#### Required: |
| 208 | + |
| 209 | +* `recipient` - (String) Channel, private group, or IM channel (can be an encoded ID or a name) to send messages to. |
| 210 | + |
| 211 | +#### Optional: |
| 212 | + |
| 213 | +* `endpoint_url` - (String) Use this to override the Slack API endpoint URL to send requests to. |
| 214 | +* `mention_channel` - (String) Describes how to ping the slack channel that messages are being sent to. Options are `here` for an @here ping, `channel` for @channel, or empty for no ping. |
| 215 | +* `mention_groups` - (String) Comma-separated list of groups to mention in the message. |
| 216 | +* `mention_users` - (String) Comma-separated list of users to mention in the message. |
| 217 | +* `text` - (String) Templated content of the message. |
| 218 | +* `title` - (String) Templated title of the message. |
| 219 | +* `token` - (String, Sensitive) A Slack API token,for sending messages directly without the webhook method. |
| 220 | +* `url` - (String, Sensitive) A Slack webhook URL,for sending messages via the webhook method. |
| 221 | +* `username` - (String) Username for the bot to use. |
| 222 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 223 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 224 | + |
| 225 | +### Attribute Reference |
| 226 | + |
| 227 | +* `uid` - (String) The UID of the contact point. |
| 228 | + |
| 229 | +## Nested schema for `teams`: |
| 230 | + |
| 231 | +#### Required: |
| 232 | + |
| 233 | +* `url` - (String, Sensitive) A Teams webhook URL. |
| 234 | + |
| 235 | +#### Optional: |
| 236 | + |
| 237 | +* `message` - (String) The templated message content to send. |
| 238 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 239 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 240 | + |
| 241 | +### Attribute Reference |
| 242 | + |
| 243 | +* `uid` - (String) The UID of the contact point. |
| 244 | + |
| 245 | +## Nested schema for `victorops`: |
| 246 | + |
| 247 | +#### Required: |
| 248 | + |
| 249 | +* `url` - (String) The VictorOps webhook URL. |
| 250 | + |
| 251 | +#### Optional: |
| 252 | + |
| 253 | +* `message_type` - (String) The VictorOps alert state - typically either `CRITICAL` or `WARNING`. |
| 254 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 255 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 256 | + |
| 257 | +### Attribute Reference |
| 258 | + |
| 259 | +* `uid` - (String) The UID of the contact point. |
| 260 | + |
| 261 | +## Nested schema for `webhook`: |
| 262 | + |
| 263 | +#### Required: |
| 264 | + |
| 265 | +* `url` - (String) The URL to send webhook requests to. |
| 266 | + |
| 267 | +#### Optional: |
| 268 | + |
| 269 | +* `http_method` - (String) The HTTP method to use in the request. Can be either `PUT` or `POST`. |
| 270 | +* `max_alerts` - (Number) The maximum number of alerts to send in a single request. This can be helpful in limiting the size of the request body. The default is 0, which indicates no limit. |
| 271 | +* `password` - (String, Sensitive) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used. |
| 272 | +* `username` - (String) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used. |
| 273 | +* `disable_resolve_message` - (Boolean) Whether to disable sending resolve messages. Defaults to `false`. |
| 274 | +* `settings` - (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`. |
| 275 | + |
| 276 | +### Attribute Reference |
| 277 | + |
| 278 | +* `uid` - (String) The UID of the contact point. |
| 279 | + |
| 280 | +## Import contact point as resource |
| 281 | + |
| 282 | +You can import contact point as follows: |
| 283 | + |
| 284 | +``` |
| 285 | +terraform import logzio_grafana_contact_point.my_cp <CONTACT-POINT-NAME> |
| 286 | +``` |
0 commit comments