-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathpagerduty.tf
59 lines (50 loc) · 1.3 KB
/
pagerduty.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Configure the PagerDuty provider
provider "pagerduty" {
token = "6GsKp9Y5_c6axFRQvMTv"
}
# Create a PagerDuty team
resource "pagerduty_team" "engineering" {
name = "Engineering"
description = "All engineering"
}
resource "pagerduty_user" "example" {
name = "Howard James"
email = "howard.james@example.domain"
teams = ["${pagerduty_team.engineering.id}"]
}
data "pagerduty_extension_schema" "webhook" {
name = "Generic V2 Webhook"
}
resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy"
num_loops = 2
rule {
escalation_delay_in_minutes = 10
target {
type = "user"
id = pagerduty_user.example.id
}
}
}
resource "pagerduty_service" "example" {
name = "My Web App"
auto_resolve_timeout = 14400
acknowledgement_timeout = 600
escalation_policy = pagerduty_escalation_policy.foo.id
}
resource "pagerduty_extension" "slack" {
name = "My Web App Extension"
extension_schema = data.pagerduty_extension_schema.webhook.id
extension_objects = ["${pagerduty_service.example.id}"]
config = <<EOF
{
"restrict": "any",
"notify_types": {
"resolve": false,
"acknowledge": false,
"assignments": false
},
"access_token": "XXX"
}
EOF
}