Skip to content

Commit 4e87baa

Browse files
authored
irm: enable grafana assistant webhook preset (#2391)
1 parent a7c8142 commit 4e87baa

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/resources/oncall_outgoing_webhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ resource "grafana_oncall_outgoing_webhook" "test-acc-outgoing_webhook-incident"
5757
- `integration_filter` (List of String) Restricts the outgoing webhook to only trigger if the event came from a selected integration. If no integrations are selected the outgoing webhook will trigger for any integration.
5858
- `is_webhook_enabled` (Boolean) Controls whether the outgoing webhook will trigger or is ignored. Defaults to `true`.
5959
- `password` (String, Sensitive) The auth data of the webhook. Used for Basic authentication
60-
- `preset` (String) The preset of the outgoing webhook. Possible values are: `simple_webhook`, `advanced_webhook`, `grafana_sift`, `incident_webhook`. If no preset is set, the default preset is `advanced_webhook`.
60+
- `preset` (String) The preset of the outgoing webhook. Possible values are: `simple_webhook`, `advanced_webhook`, `grafana_sift`, `grafana_assistant`, `incident_webhook`. If no preset is set, the default preset is `advanced_webhook`.
6161
- `team_id` (String) The ID of the OnCall team (using the `grafana_oncall_team` datasource).
6262
- `trigger_template` (String) A template used to dynamically determine whether the webhook should execute based on the content of the payload.
6363
- `trigger_type` (String) The type of event that will cause this outgoing webhook to execute. The events available will depend on the preset used. For alert group webhooks, the possible triggers are: `escalation`, `alert group created`, `status change`, `acknowledge`, `resolve`, `silence`, `unsilence`, `unresolve`, `unacknowledge`, `resolution note added`, `personal notification`; for incident webhooks: `incident declared`, `incident changed`, `incident resolved`. Defaults to `escalation`.

internal/resources/oncall/resource_outgoing_webhook.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ import (
1515
// modified by users; these fields are automatically suppressed from diffs when a preset is active.
1616
// presetControlledFields maps preset names to lists of field names that are controlled by that preset
1717
var presetControlledFields = map[string][]string{
18-
"advanced_webhook": {},
19-
"grafana_sift": {"authorization_header", "data", "forward_whole_payload", "headers", "http_method", "password", "url", "user"},
20-
"incident_webhook": {"integration_filter"},
21-
"simple_webhook": {"authorization_header", "data", "forward_whole_payload", "headers", "http_method", "integration_filter", "password", "trigger_template", "trigger_type", "user"},
18+
"advanced_webhook": {},
19+
"grafana_sift": {"authorization_header", "data", "forward_whole_payload", "headers", "http_method", "password", "url", "user"},
20+
"incident_webhook": {"integration_filter"},
21+
"grafana_assistant": {"authorization_header", "data", "forward_whole_payload", "headers", "http_method", "password", "url", "user"},
22+
"simple_webhook": {"authorization_header", "data", "forward_whole_payload", "headers", "http_method", "integration_filter", "password", "trigger_template", "trigger_type", "user"},
2223
}
2324

2425
// isFieldControlledByPreset checks if a field is controlled by the current preset
@@ -67,7 +68,7 @@ func resourceOutgoingWebhook() *common.Resource {
6768
"preset": {
6869
Type: schema.TypeString,
6970
Optional: true,
70-
Description: "The preset of the outgoing webhook. Possible values are: `simple_webhook`, `advanced_webhook`, `grafana_sift`, `incident_webhook`. If no preset is set, the default preset is `advanced_webhook`.",
71+
Description: "The preset of the outgoing webhook. Possible values are: `simple_webhook`, `advanced_webhook`, `grafana_sift`, `grafana_assistant`, `incident_webhook`. If no preset is set, the default preset is `advanced_webhook`.",
7172
},
7273
"team_id": {
7374
Type: schema.TypeString,

0 commit comments

Comments
 (0)