-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "Zenduty: SLAs" | ||
subcategory: "" | ||
description: |- | ||
Provides a Zenduty SLAs Resource. This allows SLAs to be created, updated, and deleted. | ||
--- | ||
|
||
# Resource : zenduty_sla | ||
Provides a Zenduty SLAs Resource. This allows SLAs to be created, updated, and deleted. | ||
## Example Usage | ||
```hcl | ||
resource "zenduty_teams" "exampleteam" { | ||
name = "exmaple team" | ||
} | ||
data "zenduty_user" "user1" { | ||
email = "[email protected]" | ||
} | ||
``` | ||
|
||
```hcl | ||
resource "zenduty_sla" "example_sla" { | ||
name = "demo sla" | ||
description = "this is a demo sla" | ||
team_id = zenduty_teams.exampleteam.id | ||
acknowledge_time = 5 | ||
resolve_time = 10 | ||
escalations { | ||
time = 30 | ||
type = 1 | ||
responders { | ||
user = data.zenduty_user.user1.users[0].username | ||
} | ||
} | ||
escalations { | ||
time = -10 | ||
type = 2 | ||
responders { | ||
user = data.zenduty_user.user1.users[0].username | ||
} | ||
} | ||
} | ||
``` | ||
|
||
|
||
## Argument Reference | ||
|
||
* `team_id` - (Required) The unique_id of team to create the sla in. | ||
* `name` - (Required) The name of the sla. | ||
* `description` - (Required) The description of the sla | ||
* `acknowledge_time` - (Required) time in seconds to trigger SLA if not acknowledged. | ||
* `resolve_time` - (Required) Time in seconds to trigger SLA if not resolved. | ||
* `escalations` - (Required) Reminders when an SLA is breached or about to breach. (see [below for nested schema](#nestedblock--escalation)) | ||
|
||
```hcl | ||
escalations { | ||
time = 30 | ||
type = 1 | ||
responders { | ||
user = data.zenduty_user.user1.users[0].username | ||
} | ||
} | ||
``` | ||
|
||
<a id="nestedblock--escalation"></a> | ||
|
||
* `type`: It is an integer field that determines the type of notification behavior. `1` signifies that notifications are sent when the SLA breach is acknowledged, while `2` indicates notifications for resolution SLA breaches. | ||
* `time`: This field specifies the time duration in seconds when notifications should be sent. If time is positive, it means notifications will be sent x seconds after the SLA breach, and if it's negative, notifications will be sent x seconds before the breach. | ||
* `responders` - users who need to be paged when an SLA is breached. (see [below for nested schema](#nestedblock--responders)) | ||
|
||
|
||
<a id="nestedblock--responders"></a> | ||
|
||
```hcl | ||
responders { | ||
user = data.zenduty_user.user1.users[0].username | ||
} | ||
``` | ||
* `user` - Username of the user who will be notified if sla is breached | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The ID of the Zenduty SlA. | ||
|
||
## Import | ||
|
||
Team SLAs can be imported using the `team_id`(ie. unique_id of the team) and `sla_id`(ie. unique_id of the sla), e.g. | ||
|
||
```hcl | ||
resource "zenduty_sla" "sla1" { | ||
} | ||
``` | ||
|
||
`$ terraform import zenduty_sla.sla1 team_id/sla_id` | ||
|
||
`$ terraform state show zenduty_sla.sla1` | ||
|
||
`* copy the output data and paste inside zenduty_sla.sla1 resource block and remove the id attribute` | ||
|
||
`$ terraform plan` to verify the import | ||
|
||
|
||
|
||
|
||
|