Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc & var updates #3

Merged
merged 13 commits into from
Dec 5, 2023
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ The following resources are used by this module:

The following input variables are required:

### <a name="input_dag"></a> [dag](#input\_dag)
### <a name="input_description"></a> [description](#input\_description)

Description: The name of the AVD Application Group.
Description: The description of the AVD Application Group.

Type: `string`

### <a name="input_dagtype"></a> [dagtype](#input\_dagtype)
### <a name="input_hostpool"></a> [hostpool](#input\_hostpool)

Description: The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'.
Description: The name of the AVD Host Pool to assign the application group to.

Type: `string`

### <a name="input_hostpool"></a> [hostpool](#input\_hostpool)
### <a name="input_name"></a> [name](#input\_name)

Description: The name of the AVD Host Pool to assign the application group to.
Description: The name of the AVD Application Group.

Type: `string`

Expand All @@ -70,6 +70,12 @@ Description: The resource group where the resources will be deployed.

Type: `string`

### <a name="input_type"></a> [type](#input\_type)

Description: The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'.

Type: `string`

### <a name="input_user_group_name"></a> [user\_group\_name](#input\_user\_group\_name)

Description: Microsoft Entra ID User Group for AVD users
Expand Down
37 changes: 23 additions & 14 deletions examples/default/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- BEGIN_TF_DOCS -->
# Default example

This deploys the module in its simplest form.
This deploys the module in its simplest form for Desktop Application Group with the Desktop type

```hcl
terraform {
Expand Down Expand Up @@ -50,8 +50,9 @@ resource "azurerm_log_analytics_workspace" "this" {
module "appgroup" {
source = "../../"
enable_telemetry = var.enable_telemetry
dagtype = var.dagtype
dag = var.dag
type = var.type
name = var.name
description = var.description
hostpool = var.host_pool
user_group_name = var.user_group_name
resource_group_name = var.resource_group_name
Expand Down Expand Up @@ -100,21 +101,13 @@ No required inputs.

The following input variables are optional (have default values):

### <a name="input_dag"></a> [dag](#input\_dag)
### <a name="input_description"></a> [description](#input\_description)

Description: The name of the AVD Application Group.

Type: `string`

Default: `"appgroup-1"`

### <a name="input_dagtype"></a> [dagtype](#input\_dagtype)

Description: The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'.
Description: The description of the AVD Application Group.

Type: `string`

Default: `"Desktop"`
Default: `"AVD Application Group"`

### <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry)

Expand Down Expand Up @@ -142,6 +135,14 @@ Type: `string`

Default: `"eastus"`

### <a name="input_name"></a> [name](#input\_name)

Description: The name of the AVD Application Group.

Type: `string`

Default: `"appgroup-1"`

### <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name)

Description: The resource group where the AVD Host Pool is deployed.
Expand All @@ -150,6 +151,14 @@ Type: `string`

Default: `"rg-avm-test"`

### <a name="input_type"></a> [type](#input\_type)

Description: The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'.

Type: `string`

Default: `"Desktop"`

### <a name="input_user_group_name"></a> [user\_group\_name](#input\_user\_group\_name)

Description: Microsoft Entra ID User Group for AVD users
Expand Down
2 changes: 1 addition & 1 deletion examples/default/_header.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Default example

This deploys the module in its simplest form.
This deploys the module in its simplest form for Desktop Application Group with the Desktop type
5 changes: 3 additions & 2 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ resource "azurerm_log_analytics_workspace" "this" {
module "appgroup" {
source = "../../"
enable_telemetry = var.enable_telemetry
dagtype = var.dagtype
dag = var.dag
type = var.type
name = var.name
description = var.description
hostpool = var.host_pool
user_group_name = var.user_group_name
resource_group_name = var.resource_group_name
Expand Down
12 changes: 9 additions & 3 deletions examples/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ If it is set to false, then no telemetry will be collected.
DESCRIPTION
}

variable "dag" {
variable "name" {
type = string
description = "The name of the AVD Application Group."
default = "appgroup-1"
validation {
condition = can(regex("^[a-z0-9-]{3,24}$", var.dag))
condition = can(regex("^[a-z0-9-]{3,24}$", var.name))
error_message = "The name must be between 3 and 24 characters long and can only contain lowercase letters, numbers and dashes."
}
}

variable "dagtype" {
variable "type" {
type = string
default = "Desktop"
description = "The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'."
}

variable "description" {
type = string
default = "AVD Application Group"
description = "The description of the AVD Application Group."
}

variable "host_pool" {
type = string
default = "avdhostpool"
Expand Down
37 changes: 23 additions & 14 deletions examples/remoteapp/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- BEGIN_TF_DOCS -->
# Remoteapp example

This deploys the module for remoteapp with 2 sample applications
This deploys the module for Desktop Application Group with the remoteapp type with 2 sample applications.

```hcl
terraform {
Expand Down Expand Up @@ -50,8 +50,9 @@ resource "azurerm_log_analytics_workspace" "this" {
module "appgroup" {
source = "../../"
enable_telemetry = var.enable_telemetry
dagtype = var.dagtype
dag = var.dag
type = var.type
name = var.name
description = var.description
hostpool = var.host_pool
user_group_name = var.user_group_name
resource_group_name = var.resource_group_name
Expand Down Expand Up @@ -128,21 +129,13 @@ No required inputs.

The following input variables are optional (have default values):

### <a name="input_dag"></a> [dag](#input\_dag)
### <a name="input_description"></a> [description](#input\_description)

Description: The name of the AVD Application Group.

Type: `string`

Default: `"appgroup-2"`

### <a name="input_dagtype"></a> [dagtype](#input\_dagtype)

Description: The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'.
Description: The description of the AVD Application Group.

Type: `string`

Default: `"RemoteApp"`
Default: `"AVD Application Group"`

### <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry)

Expand Down Expand Up @@ -170,6 +163,14 @@ Type: `string`

Default: `"eastus"`

### <a name="input_name"></a> [name](#input\_name)

Description: The name of the AVD Application Group.

Type: `string`

Default: `"appgroup-2"`

### <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name)

Description: The resource group where the AVD Host Pool is deployed.
Expand All @@ -178,6 +179,14 @@ Type: `string`

Default: `"rg-avm-test"`

### <a name="input_type"></a> [type](#input\_type)

Description: The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'.

Type: `string`

Default: `"RemoteApp"`

### <a name="input_user_group_name"></a> [user\_group\_name](#input\_user\_group\_name)

Description: Microsoft Entra ID User Group for AVD users
Expand Down
2 changes: 1 addition & 1 deletion examples/remoteapp/_header.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Remoteapp example

This deploys the module for remoteapp with 2 sample applications
This deploys the module for Desktop Application Group with the remoteapp type with 2 sample applications.
5 changes: 3 additions & 2 deletions examples/remoteapp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ resource "azurerm_log_analytics_workspace" "this" {
module "appgroup" {
source = "../../"
enable_telemetry = var.enable_telemetry
dagtype = var.dagtype
dag = var.dag
type = var.type
name = var.name
description = var.description
hostpool = var.host_pool
user_group_name = var.user_group_name
resource_group_name = var.resource_group_name
Expand Down
12 changes: 9 additions & 3 deletions examples/remoteapp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ If it is set to false, then no telemetry will be collected.
DESCRIPTION
}

variable "dag" {
variable "name" {
type = string
description = "The name of the AVD Application Group."
default = "appgroup-2"
validation {
condition = can(regex("^[a-z0-9-]{3,24}$", var.dag))
condition = can(regex("^[a-z0-9-]{3,24}$", var.name))
error_message = "The name must be between 3 and 24 characters long and can only contain lowercase letters, numbers and dashes."
}
}

variable "dagtype" {
variable "type" {
type = string
default = "RemoteApp"
description = "The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'."
}

variable "description" {
type = string
default = "AVD Application Group"
description = "The description of the AVD Application Group."
}

variable "host_pool" {
type = string
default = "avdhostpool"
Expand Down
19 changes: 10 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ data "azurerm_virtual_desktop_host_pool" "this" {

# Create Azure Virtual Desktop application grop
resource "azurerm_virtual_desktop_application_group" "dag" {
name = var.name
location = data.azurerm_virtual_desktop_host_pool.this.location
resource_group_name = var.resource_group_name
host_pool_id = data.azurerm_virtual_desktop_host_pool.this.id
type = var.dagtype
name = var.dag
friendly_name = var.dag
description = "AVD Desktop application group"
type = var.type
friendly_name = var.name
description = var.description
tags = var.tags
}

Expand All @@ -34,10 +34,11 @@ resource "azurerm_role_assignment" "role" {

# Create Diagnostic Settings for AVD application group
resource "azurerm_monitor_diagnostic_setting" "this" {
for_each = var.diagnostic_settings
name = each.value.name != null ? each.value.name : "diag-${var.dag}"
target_resource_id = azurerm_virtual_desktop_application_group.dag.id
storage_account_id = each.value.storage_account_resource_id
for_each = var.diagnostic_settings
name = each.value.name != null ? each.value.name : "diag-${var.name}"
target_resource_id = azurerm_virtual_desktop_application_group.dag.id
storage_account_id = each.value.storage_account_resource_id

eventhub_authorization_rule_id = each.value.event_hub_authorization_rule_resource_id
eventhub_name = each.value.event_hub_name
partner_solution_id = each.value.marketplace_partner_resource_id
Expand Down Expand Up @@ -72,7 +73,7 @@ resource "azurerm_role_assignment" "this" {

resource "azurerm_management_lock" "this" {
count = var.lock.kind != "None" ? 1 : 0
name = coalesce(var.lock.name, "lock-${var.dag}")
name = coalesce(var.lock.name, "lock-${var.name}")
scope = azurerm_virtual_desktop_application_group.dag.id
lock_level = var.lock.kind
}
11 changes: 8 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,25 @@ variable "resource_group_name" {
description = "The resource group where the resources will be deployed."
}

variable "dag" {
variable "name" {
type = string
description = "The name of the AVD Application Group."
validation {
condition = can(regex("^[a-z0-9-]{3,24}$", var.dag))
condition = can(regex("^[a-z0-9-]{3,24}$", var.name))
error_message = "The name must be between 3 and 24 characters long and can only contain lowercase letters, numbers and dashes."
}
}

variable "dagtype" {
variable "type" {
type = string
description = "The type of the AVD Application Group. Valid values are 'Desktop' and 'RemoteApp'."
}

variable "description" {
type = string
description = "The description of the AVD Application Group."
}

variable "hostpool" {
type = string
description = "The name of the AVD Host Pool to assign the application group to."
Expand Down
Loading