Skip to content

Commit

Permalink
docs: Correct opsgenie_escalation multiple rules (#307)
Browse files Browse the repository at this point in the history
* docs: Correct opsgenie_escalation multiple rules

* docs: add hcl to highlight syntax

* docs: convert tabs to spaces

* docs: clarify notify type with escalation recipient type

* docs: add missing curly brace

---------

Co-authored-by: koushik-swaminathan <[email protected]>
  • Loading branch information
nitrocode and koushik-swaminathan authored Oct 17, 2023
1 parent 8549f09 commit b640450
Showing 1 changed file with 39 additions and 22 deletions.
61 changes: 39 additions & 22 deletions website/docs/r/escalation.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ Manages an Escalation within Opsgenie.

## Example Usage

An escalation with a single rule

```hcl
resource "opsgenie_escalation" "test" {
name = "genieescalation-%s"
resource "opsgenie_escalation" "default" {
name = "genieescalation"
rules {
condition = "if-not-acked"
Expand All @@ -23,15 +25,19 @@ resource "opsgenie_escalation" "test" {
recipient {
type = "user"
id = "${opsgenie_user.test.id}"
}
}
id = opsgenie_user.test.id
}
}
}
```

An escalation with a multiple rules

resource "opsgenie_escalation" "test" {
name = "genieescalation-%s"
```hcl
resource "opsgenie_escalation" "default" {
name = "genieescalation"
description = "test"
owner_team_id = "${opsgenie_team.test.id}"
owner_team_id = opsgenie_team.test.id
rules {
condition = "if-not-acked"
Expand All @@ -40,21 +46,33 @@ resource "opsgenie_escalation" "test" {
recipient {
type = "user"
id = "${opsgenie_user.test.id}"
id = opsgenie_user.test.id
}
}
rules {
condition = "if-not-acked"
notify_type = "default"
delay = 1
recipient {
type = "team"
id = "${opsgenie_team.test.id}"
id = opsgenie_team.test.id
}
}
rules {
condition = "if-not-acked"
notify_type = "default"
delay = 1
recipient {
type = "schedule"
id = "${opsgenie_schedule.test.id}"
id = opsgenie_schedule.test.id
}
}
repeat {
repeat {
wait_interval = 10
count = 1
reset_recipient_states = true
Expand All @@ -69,30 +87,30 @@ The following arguments are supported:

* `name` - (Required) Name of the escalation.

* `rules` - (Required) List of the escalation rules.
* `rules` - (Required) List of the escalation rules. See below for how rules are defined.

* `description` - (Optional) Description of the escalation.

* `owner_team_id` - (Optional) Owner team id of the escalation.

* `repeat` - (Optional) Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed


`rules` supports the following:

* `condition` - (Required) The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: `if-not-acked` and `if-not-closed`. Default: `if-not-acked`

* `notify_type` - (Required) Recipient calculation logic for schedules. Possible values are:

- `default`: on call users
- `next`: next users in rotation
- `previous`: previous users on rotation
- `users`: users of the team
- `admins`: admins of the team
- `all`: all members of the team
- `next`: next users in `schedule` rotation
- `previous`: previous users on `schedule` rotation
- `users`: users of the `team`
- `admins`: admins of the `team`
- `all`: all members of the `team`

* `recipient` - (Required) Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: `user`, `schedule`, `team`.
* `delay` - (Required) Time delay of the escalation rule, in minutes.
* `recipient` - (Required) Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: `user`, `schedule`, `team`. There can only be one recipient per each `rules`.

* `delay` - (Required) Time delay of the escalation rule, in minutes.

## Attributes Reference

Expand All @@ -105,4 +123,3 @@ The following attributes are exported:
Escalations can be imported using the `escalation_id`, e.g.

`$ terraform import opsgenie_escalation.test escalation_id`

0 comments on commit b640450

Please sign in to comment.