-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincident_workflows.tf
91 lines (85 loc) · 2.19 KB
/
incident_workflows.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
resource "pagerduty_incident_workflow" "major_incident" {
name = "Major Incident Workflow"
description = "This Incident Workflow is an example"
step {
name = "Send Status Update"
action = "pagerduty.com:incident-workflows:send-status-update:1"
input {
name = "Message"
value = "Major incident declared. Expect next status update in 15 minutes."
}
}
step {
action = "pagerduty.com:incident-workflows:add-responders:1"
name = "Add Responders"
input {
name = "Message"
value = "Please help me with {{incident.title}} - {{incident.url}}"
}
input {
name = "Responders"
value = jsonencode(
[
jsonencode(
{
id = pagerduty_escalation_policy.cloud.id
type = "escalation_policy"
}
),
jsonencode(
{
id = pagerduty_escalation_policy.security.id
type = "escalation_policy"
}
),
jsonencode(
{
id = pagerduty_user.users["daffy.duck"].id
type = "user"
}
),
]
)
}
}
step {
action = "pagerduty.com:incident-workflows:add-stakeholders:1"
name = "Add Stakeholders"
input {
name = "Stakeholders"
value = jsonencode(
[
jsonencode(
{
id = pagerduty_team.teams["cloud"].id
type = "team"
}
),
jsonencode(
{
id = pagerduty_team.teams["security"].id
type = "team"
}
),
jsonencode(
{
id = pagerduty_user.users["security1"].id
type = "user"
}
),
jsonencode(
{
id = pagerduty_user.users["cloud1"].id
type = "user"
}
),
]
)
}
}
}
resource "pagerduty_incident_workflow_trigger" "major_incident_manual_trigger" {
type = "manual"
workflow = pagerduty_incident_workflow.major_incident.id
subscribed_to_all_services = true
}