-
Notifications
You must be signed in to change notification settings - Fork 0
/
avd.tf
172 lines (147 loc) · 3.99 KB
/
avd.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
resource "azurerm_resource_group" "avd" {
name = "avd-rg"
location = var.location
}
resource "azurerm_virtual_desktop_host_pool" "avd-pool" {
location = azurerm_resource_group.avd.location
resource_group_name = azurerm_resource_group.avd.name
name = var.host_pool_name
friendly_name = "pooleddepthfirst"
validate_environment = true
start_vm_on_connect = true
custom_rdp_properties = "audiocapturemode:i:1;audiomode:i:0;"
description = "Acceptance Test: A pooled host pool - pooleddepthfirst"
type = "Pooled"
maximum_sessions_allowed = 2
load_balancer_type = "DepthFirst"
registration_info {
expiration_date = "2021-09-20T08:00:00Z" # Must be set to a time between 1 hour in the future & 27 days in the future
}
}
# Diagnostic settings
resource "azurerm_monitor_diagnostic_setting" "avd-pool-diags" {
name = "adds-diags"
target_resource_id = azurerm_virtual_desktop_host_pool.avd-pool.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.avd-workspace.id
log {
category = "Checkpoint"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Error"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Management"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Connection"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "HostRegistration"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "AgentHealthStatus"
enabled = true
retention_policy {
enabled = false
}
}
}
resource "azurerm_virtual_desktop_application_group" "desktopapp" {
name = "appgroupdesktop"
location = azurerm_resource_group.avd.location
resource_group_name = azurerm_resource_group.avd.name
type = "Desktop"
host_pool_id = azurerm_virtual_desktop_host_pool.avd-pool.id
friendly_name = "TestAppGroup"
description = "Acceptance Test: An application group"
}
resource "azurerm_monitor_diagnostic_setting" "desktopapps-appgroup-diags" {
name = "adds-diags"
target_resource_id = azurerm_virtual_desktop_application_group.desktopapp.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.avd-workspace.id
log {
category = "Checkpoint"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Error"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Management"
enabled = true
retention_policy {
enabled = false
}
}
}
resource "azurerm_virtual_desktop_workspace" "workspace" {
name = "workspace"
location = azurerm_resource_group.avd.location
resource_group_name = azurerm_resource_group.avd.name
friendly_name = "FriendlyName"
description = "A description of my workspace"
}
resource "azurerm_monitor_diagnostic_setting" "avd-workspace-diags" {
name = "adds-diags"
target_resource_id = azurerm_virtual_desktop_workspace.workspace.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.avd-workspace.id
log {
category = "Checkpoint"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Error"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Management"
enabled = true
retention_policy {
enabled = false
}
}
log {
category = "Feed"
enabled = true
retention_policy {
enabled = false
}
}
}
resource "azurerm_virtual_desktop_workspace_application_group_association" "workspaceremoteapp" {
workspace_id = azurerm_virtual_desktop_workspace.workspace.id
application_group_id = azurerm_virtual_desktop_application_group.desktopapp.id
}