Update documentation

This commit is contained in:
Alexander Hellbom 2016-10-16 03:52:45 +02:00
parent d02067a75e
commit 5c99f1317a
7 changed files with 201 additions and 96 deletions

View File

@ -20,23 +20,18 @@ resource "pagerduty_user" "example" {
teams = ["${pagerduty_team.example.id}"]
}
resource "pagerduty_escalation_policy" "example" {
name = "Engineering"
description = "Engineering Escalation Policy"
num_loops = 2
escalation_rules = <<EOF
[
{
"escalation_delay_in_minutes": 10,
"targets": [
{
"type": "user",
"id": "${pagerduty_user.example.id}"
}
]
}
]
EOF
resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy"
num_loops = 2
escalation_rule {
escalation_delay_in_minutes = 10
target {
type = "user"
id = "${pagerduty_user.example.id}"
}
}
}
```
@ -44,19 +39,32 @@ EOF
The following arguments are supported:
* `name` - (Required) The name of the escalation policy.
* `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.
* `escalation_rules` (Required) A JSON array containing escalation rules. Each rule must have `escalation_delay_in_minutes` defined as well as an array containing `targets`
* `escalation_delay_in_minutes` (Required) The number of minutes before an unacknowledged incident escalates away from this rule.
* `targets` (Required) The targets an incident should be assigned to upon reaching this rule.
* `name` - (Required) The name of the escalation policy.
* `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.
* `escalation_rule` - (Required) An Escalation rule block. Escalation rules documented below.
Escalation rules (`escalation_rule`) supports the following:
* `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:
* `type` - (Optional) Can be `user`, `schedule`, `user_reference` or `schedule_reference`. Defaults to `user_reference`
* `id` - (Required) A target ID
## Attributes Reference
The following attributes are exported:
* `id` - The ID of the escalation policy.
* `name` - The name of the escalation policy.
* `description` - Escalation policy description.
* `num_loops` - The number of times the escalation policy will repeat after reaching the end of its escalation.
## Import
Escalation policies can be imported using the `id`, e.g.
```
$ terraform import pagerduty_escalation_policy.main PLBP09X
```

View File

@ -0,0 +1,82 @@
---
layout: "pagerduty"
page_title: "PagerDuty: pagerduty_schedule"
sidebar_current: "docs-pagerduty-resource-schedule"
description: |-
Creates and manages a schedule in PagerDuty.
---
# pagerduty\_schedule
A [schedule](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Schedules/get_schedules) determines the time periods that users are on call. Only on-call users are eligible to receive notifications from incidents.
## Example Usage
```
resource "pagerduty_user" "example" {
name = "Earline Greenholt"
email = "125.greenholt.earline@graham.name"
teams = ["${pagerduty_team.example.id}"]
}
resource "pagerduty_schedule" "foo" {
name = "Daily Engineering Rotation"
time_zone = "America/New_York"
schedule_layer {
name = "Night Shift"
start = "2015-11-06T20:00:00-05:00"
rotation_virtual_start = "2015-11-06T20:00:00-05:00"
rotation_turn_length_seconds = 86400
users = ["${pagerduty_user.foo.id}"]
restriction {
type = "daily_restriction"
start_time_of_day = "08:00:00"
duration_seconds = 32400
}
}
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Optional) The name of the escalation policy.
* `time_zone` - (Required) The time zone of the schedule (e.g Europe/Berlin).
* `description` - (Optional) The description of the schedule
* `schedule_layer` - (Required) A schedule layer block. Schedule layers documented below.
Schedule layers (`schedule_layer`) supports the following:
* `name` - (Optional) The name of the schedule layer.
* `start` - (Required) The start time of the schedule layer.
* `end` - (Optional) The end time of the schedule layer. If not specified, the layer does not end.
* `rotation_virtual_start` - (Required) The effective start time of the schedule layer. This can be before the start time of the schedule.
* `rotation_turn_length_seconds` - (Required) The duration of each on-call shift in `seconds`.
* `users` - (Required) The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
* `restriction` - (Optional) A schedule layer restriction block. Restriction blocks documented below.
Restriction blocks (`restriction`) supports the following:
* `type` - (Required) Can be `daily_restriction` or `weekly_restriction`
* `start_time_of_day` - (Required) The duration of the restriction in `seconds`.
* `duration_seconds` - (Required) The start time in `HH:mm:ss` format.
## Attributes Reference
The following attributes are exported:
* `id` - The ID of the schedule
## Import
Schedules can be imported using the `id`, e.g.
```
$ terraform import pagerduty_schedule.main PLBP09X
```

View File

@ -20,23 +20,18 @@ resource "pagerduty_user" "example" {
teams = ["${pagerduty_team.example.id}"]
}
resource "pagerduty_escalation_policy" "example" {
name = "Engineering"
description = "Engineering Escalation Policy"
num_loops = 2
escalation_rules = <<EOF
[
{
"escalation_delay_in_minutes": 10,
"targets": [
{
"type": "user",
"id": "${pagerduty_user.example.id}"
}
]
}
]
EOF
resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy"
num_loops = 2
escalation_rule {
escalation_delay_in_minutes = 10
target {
type = "user"
id = "${pagerduty_user.example.id}"
}
}
}
resource "pagerduty_service" "example" {
@ -50,19 +45,23 @@ resource "pagerduty_service" "example" {
## Argument Reference
The following arguments are supported:
* `name` - (Required) The name of the service.
* `description` - (Optional) A human-friendly description of the escalation policy.
If not set, a placeholder of "Managed by Terraform" will be set.
* `auto_resolve_timeout` (Optional) Time in seconds that an incident is automatically resolved if left open for that long. Value is "null" is the feature is disabled.
* `acknowledgement_timeout` (Optional) Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is "null" is the feature is disabled.
* `auto_resolve_timeout` - (Optional) Time in seconds that an incident is automatically resolved if left open for that long. Value is "null" is the feature is disabled.
* `acknowledgement_timeout` - (Optional) Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is "null" is the feature is disabled.
* `escalation_policy` - (Required) The escalation policy used by this service.
## Attributes Reference
The following attributes are exported:
* `id` - The ID of the service.
* `name` - (Required) The name of the service.
* `description` - The user-provided description of the service.
* `auto_resolve_timeout` Time in seconds that an incident is automatically resolved if left open for that long.
* `acknowledgement_timeout` (Optional) Time in seconds that an incident changes to the Triggered State after being Acknowledged.
## Import
Services can be imported using the `id`, e.g.
```
$ terraform import pagerduty_service.main PLBP09X
```

View File

@ -33,5 +33,11 @@ The following arguments are supported:
The following attributes are exported:
* `id` - The ID of the team.
* `name` - The name of the team.
* `description` - The description of the team.
## Import
Teams can be imported using the `id`, e.g.
```
$ terraform import pagerduty_team.main PLBP09X
```

View File

@ -30,26 +30,29 @@ resource "pagerduty_user" "example" {
The following arguments are supported:
* `name` - (Optional) The name of the user.
* `description` - (Optional) A human-friendly description of the user.
If not set, a placeholder of "Managed by Terraform" will be set.
* `name` - (Required) The name of the user.
* `email` - (Required) The user's email address.
* `color` - (Optional) The schedule color for the user.
* `role` - (Optional) The user role. Can be `admin`, `limited_user`, `owner`, `read_only_user` or `user`
* `role` - (Optional) The user role. Account must have the `read_only_users` ability to set a user as a `read_only_user`. Can be `admin`, `limited_user`, `owner`, `read_only_user` or `user`
* `job_title` - (Optional) The user's title.
* `teams` - (Optional) A list of teams the user should belong to.
* `description` - (Optional) A human-friendly description of the user.
If not set, a placeholder of "Managed by Terraform" will be set.
## Attributes Reference
The following attributes are exported:
* `id` - The ID of the user.
* `name` - The name of the user.
* `email` - The user's email address.
* `time_zone` - The preferred time zone name.
* `role` - The user role.
* `avatar_url` - The URL of the user's avatar.
* `description` - The user's bio.
* `invitation_sent` - If true, the user has an outstanding invitation.
* `job_title` - The user's title.
* `html_url` - URL at which the entity is uniquely displayed in the Web app
* `teams` - A list of teams the user belongs to
* `invitation_sent` - If true, the user has an outstanding invitation.
## Import
Users can be imported using the `id`, e.g.
```
$ terraform import pagerduty_user.main PLBP09X
```

View File

@ -282,6 +282,10 @@
<a href="/docs/providers/packet/index.html">Packet</a>
</li>
<li<%= sidebar_current("docs-providers-pagerduty") %>>
<a href="/docs/providers/pagerduty/index.html">PagerDuty</a>
</li>
<li<%= sidebar_current("docs-providers-postgresql") %>>
<a href="/docs/providers/postgresql/index.html">PostgreSQL</a>
</li>

View File

@ -1,35 +1,38 @@
<% wrap_layout :inner do %>
<% content_for :sidebar do %>
<div class="docs-sidebar hidden-print affix-top" role="complementary">
<ul class="nav docs-sidenav">
<li<%= sidebar_current("docs-home") %>>
<a href="/docs/providers/index.html">&laquo; Documentation Home</a>
</li>
<% content_for :sidebar do %>
<div class="docs-sidebar hidden-print affix-top" role="complementary">
<ul class="nav docs-sidenav">
<li<%= sidebar_current("docs-home") %>>
<a href="/docs/providers/index.html">&laquo; Documentation Home</a>
</li>
<li<%= sidebar_current("docs-pagerduty-index") %>>
<a href="/docs/providers/pagerduty/index.html">PagerDuty Provider</a>
</li>
<li<%= sidebar_current("docs-pagerduty-index") %>>
<a href="/docs/providers/pagerduty/index.html">PagerDuty Provider</a>
</li>
<li<%= sidebar_current(/^docs-pagerduty-resource/) %>>
<a href="#">Resources</a>
<ul class="nav nav-visible">
<li<%= sidebar_current("docs-pagerduty-resource-user") %>>
<a href="/docs/providers/pagerduty/r/user.html">pagerduty_user</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-team") %>>
<a href="/docs/providers/pagerduty/r/team.html">pagerduty_team</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-escalation_policy") %>>
<a href="/docs/providers/pagerduty/r/escalation_policy.html">pagerduty_escalation_policy</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-service") %>>
<a href="/docs/providers/pagerduty/r/service.html">pagerduty_service</a>
</li>
</ul>
</li>
</ul>
</div>
<% end %>
<li<%= sidebar_current(/^docs-pagerduty-resource/) %>>
<a href="#">Resources</a>
<ul class="nav nav-visible">
<li<%= sidebar_current("docs-pagerduty-resource-device") %>>
<a href="/docs/providers/pagerduty/r/user.html">pagerduty_user</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-project") %>>
<a href="/docs/providers/pagerduty/r/team.html">pagerduty_team</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-escalation-policy") %>>
<a href="/docs/providers/pagerduty/r/escalation_policy.html">pagerduty_escalation_policy</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-schedule") %>>
<a href="/docs/providers/pagerduty/r/schedule.html">pagerduty_schedule</a>
</li>
<li<%= sidebar_current("docs-pagerduty-resource-service") %>>
<a href="/docs/providers/pagerduty/r/service.html">pagerduty_service</a>
</li>
</ul>
</li>
</ul>
</div>
<% end %>
<%= yield %>
<% end %>
<%= yield %>
<% end %>