forked from dynatrace-ace/perform2021-vhot-monaco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
environments.tf
56 lines (51 loc) · 1.53 KB
/
environments.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
resource "dynatrace_environment" "vhot_env" {
for_each = var.users
name = "${var.name_prefix}-${each.key}-${random_id.uuid.hex}"
state = var.environment_state
}
resource "dynatrace_cluster_user_group" "vhot_groups" {
for_each = var.users
name = "ext-group-${var.name_prefix}-${each.key}-${random_id.uuid.hex}"
access_rights = jsonencode(
{
VIEWER = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
MANAGE_SETTINGS = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
AGENT_INSTALL = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
LOG_VIEWER = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
VIEW_SENSITIVE_REQUEST_DATA = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
CONFIGURE_REQUEST_CAPTURE_DATA = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
REPLAY_SESSION_DATA = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
REPLAY_SESSION_DATA_WITHOUT_MASKING = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
MANAGE_SECURITY_PROBLEMS = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
MANAGE_SUPPORT_TICKETS = [
"${dynatrace_environment.vhot_env[each.key].id}"
]
}
)
}
resource "dynatrace_cluster_user" "vhot_users" {
for_each = var.users
user_id = each.value["email"]
email = each.value["email"]
first_name = each.value["firstName"]
last_name = each.value["lastName"]
groups = ["${dynatrace_cluster_user_group.vhot_groups[each.key].id}"]
}