terraform/website/source/docs/providers/pagerduty/r/escalation_policy.html.mark...

80 lines
2.4 KiB
Markdown
Raw Normal View History

2016-09-26 22:14:08 +02:00
---
layout: "pagerduty"
page_title: "PagerDuty: pagerduty_escalation_policy"
sidebar_current: "docs-pagerduty-resource-escalation_policy"
description: |-
Creates and manages an escalation policy in PagerDuty.
---
# pagerduty\_escalation_policy
An [escalation policy](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Escalation_Policies/get_escalation_policies) determines what user or schedule will be notified first, second, and so on when an incident is triggered. Escalation policies are used by one or more services.
## Example Usage
```
resource "pagerduty_team" "example" {
name = "Engineering"
description = "All engineering"
}
2016-09-26 22:14:08 +02:00
resource "pagerduty_user" "example" {
name = "Earline Greenholt"
email = "125.greenholt.earline@graham.name"
teams = ["${pagerduty_team.example.id}"]
}
resource "pagerduty_escalation_policy" "example" {
2016-10-16 03:52:45 +02:00
name = "Engineering Escalation Policy"
num_loops = 2
teams = ["${pagerduty_team.example.id}"]
2016-10-16 03:52:45 +02:00
2016-10-19 07:53:19 +02:00
rule {
2016-10-16 03:52:45 +02:00
escalation_delay_in_minutes = 10
target {
type = "user"
id = "${pagerduty_user.example.id}"
}
}
2016-09-26 22:14:08 +02:00
}
```
## Argument Reference
The following arguments are supported:
2016-10-16 03:52:45 +02:00
* `name` - (Required) The name of the escalation policy.
* `teams` - (Optional) Teams associated with the policy. Account must have the `teams` ability to use this parameter.
2016-10-16 03:52:45 +02:00
* `description` - (Optional) A human-friendly description of the escalation policy.
If not set, a placeholder of "Managed by Terraform" will be set.
* `num_loops` - (Optional) The number of times the escalation policy will repeat after reaching the end of its escalation.
2016-10-19 07:53:19 +02:00
* `rule` - (Required) An Escalation rule block. Escalation rules documented below.
2016-10-16 03:52:45 +02:00
2016-10-19 07:53:19 +02:00
Escalation rules (`rule`) supports the following:
2016-10-16 03:52:45 +02:00
* `escalation_delay_in_minutes` - (Required) The number of minutes before an unacknowledged incident escalates away from this rule.
* `targets` - (Required) A target block. Target blocks documented below.
Targets (`target`) supports the following:
2016-10-19 07:53:19 +02:00
2016-10-16 03:52:45 +02:00
* `type` - (Optional) Can be `user`, `schedule`, `user_reference` or `schedule_reference`. Defaults to `user_reference`
* `id` - (Required) A target ID
2016-09-26 22:14:08 +02:00
## Attributes Reference
The following attributes are exported:
* `id` - The ID of the escalation policy.
2016-10-16 03:52:45 +02:00
## Import
Escalation policies can be imported using the `id`, e.g.
```
$ terraform import pagerduty_escalation_policy.main PLBP09X
```