-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopsgenie.tf
82 lines (69 loc) · 1.51 KB
/
opsgenie.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
# Simple provider to handle team, members and "on-alert" rotations.
provider "opsgenie" {
version = "0.5.2"
api_url = "api.eu.opsgenie.com"
}
# USERS
resource "opsgenie_user" "userOne" {
full_name = "test test"
role = "User"
username = "test@test.test"
locale = "no_NO"
timezone = "Europe/Oslo"
}
resource "opsgenie_user" "userTwo" {
full_name = "test2 test2"
role = "User"
username = "test2@test2.test"
locale = "no_NO"
timezone = "Europe/Oslo"
}
resource "opsgenie_user" "userThree" {
full_name = "test3 test3"
role = "User"
username = "test3@test3.test"
locale = "no_NO"
timezone = "Europe/Oslo"
}
# TEAM
resource "opsgenie_team" "teamOne" {
name = "Team 1"
member {
id = opsgenie_user.userOne.id
role = "user"
}
member {
id = opsgenie_user.userTwo.id
role = "user"
}
member {
id = opsgenie_user.userThree.id
role = "user"
}
}
# SCHEDULE & ROTATION
resource "opsgenie_schedule" "schedule" {
name = "schedule"
description = "Schedule for team rotation"
enabled = true
timezone = "Europe/Oslo"
owner_team_id = opsgenie_team.teamOne.id
}
resource "opsgenie_schedule_rotation" "rotation" {
name = "rotation"
schedule_id = opsgenie_schedule.schedule.id
start_date = "2020-11-21T00:00:00Z"
type = "hourly"
participant {
type = "user"
id = opsgenie_user.userOne.id
}
participant {
type = "user"
id = opsgenie_user.userTwo.id
}
participant {
type = "user"
id = opsgenie_user.userThree.id
}
}