generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.tf
73 lines (58 loc) · 1.29 KB
/
main.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
provider "opsgenie" {
api_key = var.opsgenie_provider_api_key
}
module "escalation_team" {
source = "../../modules/team"
team = {
name = module.this.id
description = "escalation-team-description"
}
context = module.this.context
}
module "escalation" {
source = "../../modules/escalation"
escalation = {
name = module.this.id
owner_team_id = module.owner_team.team_id
rules = [{
recipient = {
type = "team"
id = module.escalation_team.team_id
}
}]
}
context = module.this.context
}
module "owner_team" {
source = "../../modules/team"
team = {
name = format("%s-%s", module.this.id, "owner-team")
description = "owner-team-description"
}
context = module.this.context
}
module "team_routing_rule" {
source = "../../modules/team_routing_rule"
team_routing_rule = {
name = module.this.id
team_id = module.owner_team.team_id
notify = [
{
type = "escalation"
id = module.escalation.escalation_id
}
]
time_restriction = {
type = "time-of-day"
restrictions = [
{
end_hour = 17
end_min = 0
start_hour = 9
start_min = 0
}
]
}
}
context = module.this.context
}