-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprod.tf
91 lines (80 loc) · 2.36 KB
/
prod.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_service" "prod" {
name = "${var.workload_name} Alerts - Prod 12x5 (${var.customer_name})"
acknowledgement_timeout = 7200
alert_creation = "create_alerts_and_incidents"
auto_resolve_timeout = 86400
escalation_policy = data.pagerduty_escalation_policy.engineering.id
incident_urgency_rule {
type = "use_support_hours"
during_support_hours {
type = "constant"
urgency = "high"
}
outside_support_hours {
type = "constant"
urgency = "low"
}
}
support_hours {
type = "fixed_time_per_day"
time_zone = "America/New_York"
start_time = "07:00:00"
end_time = "19:00:00"
days_of_week = [1, 2, 3, 4, 5]
}
scheduled_actions {
type = "urgency_change"
to_urgency = "high"
at {
type = "named_time"
name = "support_hours_start"
}
}
}
resource "pagerduty_service_dependency" "prod" {
dependency {
dependent_service {
id = pagerduty_business_service.workload.id
type = pagerduty_business_service.workload.type
}
supporting_service {
id = pagerduty_service.prod.id
type = pagerduty_service.prod.type
}
}
}
resource "pagerduty_slack_connection" "prod" {
channel_id = var.slack_engineering_prod_channel
notification_type = "responder"
source_id = pagerduty_service.prod.id
source_type = "service_reference"
workspace_id = var.slack_workspace_id
config {
events = [
"incident.triggered",
"incident.acknowledged",
"incident.escalated",
"incident.resolved",
"incident.reassigned",
"incident.unacknowledged",
"incident.delegated",
"incident.priority_updated",
"incident.responder.added",
"incident.responder.replied",
"incident.status_update_published",
"incident.reopened"
]
priorities = ["*"]
}
}
resource "pagerduty_service_integration" "prod" {
name = data.pagerduty_vendor.datadog.name
service = pagerduty_service.prod.id
vendor = data.pagerduty_vendor.datadog.id
}
resource "pagerduty_extension" "prod" {
name = "jira-${pagerduty_service.prod.id}"
config = templatefile("${path.module}/jira.json", {})
extension_objects = [pagerduty_service.prod.id]
extension_schema = data.pagerduty_extension_schema.jira.id
}