-
Notifications
You must be signed in to change notification settings - Fork 0
/
pagerduty.tf
36 lines (30 loc) · 1.03 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
resource "pagerduty_service" "test_service" {
name = "terratest-${random_string.test_instance.result}"
auto_resolve_timeout = 14400
acknowledgement_timeout = 600
escalation_policy = pagerduty_escalation_policy.test_escalation_policy.id
alert_creation = "create_alerts_and_incidents"
}
resource "pagerduty_escalation_policy" "test_escalation_policy" {
name = "Engineering Escalation Policy"
num_loops = 2
rule {
escalation_delay_in_minutes = 10
target {
type = "user_reference"
id = pagerduty_user.test_user.id
}
}
}
resource "pagerduty_user" "test_user" {
name = "Terratest User ${random_string.test_instance.result}"
email = "terratest-${random_string.test_instance.result}@honestbank.com"
}
data "pagerduty_vendor" "cloudwatch" {
name = "Cloudwatch"
}
resource "pagerduty_service_integration" "cloudwatch" {
name = data.pagerduty_vendor.cloudwatch.name
service = pagerduty_service.test_service.id
vendor = data.pagerduty_vendor.cloudwatch.id
}