Skip to content

Commit

Permalink
var & doc update (#3)
Browse files Browse the repository at this point in the history
* updates

* doc and variable updates

* fix typo

* update

* update diag

* readme updates

* doc updates

* docs

* doc updates

* fmt

* fmt

* make fmt

* make fmt

* make fmt

* make fmt

* make fmt

* make fmt

* make fmt

* fmt

* update storage

* make fmt

* outputs

* update

* docs

* fmt

* fmt

* make fmt

* make fmt

* fmt

* fmt

* fmt

* update

* doc updates

* var update

* fmt

* var update

* var and doc updates

* doc updates
  • Loading branch information
jensheerin authored Dec 5, 2023
1 parent 3e3babc commit f06aa55
Show file tree
Hide file tree
Showing 10 changed files with 368 additions and 171 deletions.
153 changes: 62 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ The following resources are used by this module:

The following input variables are required:

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

Description: The description of the AVD Scaling Plan.

Type: `string`

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

Description: The name of the AVD Host Pool to assign the scaling plan to.
Expand All @@ -51,15 +57,69 @@ Description: The Azure location where the resources will be deployed.

Type: `string`

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

Description: The name of the AVD Application Group.

Type: `string`

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

Description: The resource group where the resources will be deployed.

Type: `string`

### <a name="input_scalingplan"></a> [scalingplan](#input\_scalingplan)
### <a name="input_schedule"></a> [schedule](#input\_schedule)

Description: The name of the AVD Application Group.
Description: A map of schedules to create on AVD Scaling Plan. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

- `name` - The name of the schedule.
- `days_of_week` - The days of the week to apply the schedule to.
- `off_peak_start_time` - The start time of the off peak period.
- `off_peak_load_balancing_algorithm` - The load balancing algorithm to use during the off peak period.
- `ramp_down_capacity_threshold_percent` - The capacity threshold percentage to use during the ramp down period.
- `ramp_down_force_logoff_users` - Whether to force log off users during the ramp down period.
- `ramp_down_load_balancing_algorithm` - The load balancing algorithm to use during the ramp down period.
- `ramp_down_minimum_hosts_percent` - The minimum hosts percentage to use during the ramp down period.
- `ramp_down_notification_message` - The notification message to use during the ramp down period.
- `ramp_down_start_time` - The start time of the ramp down period.
- `ramp_down_stop_hosts_when` - When to stop hosts during the ramp down period.
- `ramp_down_wait_time_minutes` - The wait time in minutes to use during the ramp down period.
- `peak_start_time` - The start time of the peak period.
- `peak_load_balancing_algorithm` - The load balancing algorithm to use during the peak period.
- `ramp_up_capacity_threshold_percent` - (Optional) The capacity threshold percentage to use during the ramp up period.
- `ramp_up_load_balancing_algorithm` - The load balancing algorithm to use during the ramp up period.
- `ramp_up_minimum_hosts_percent` - (Optional) The minimum hosts percentage to use during the ramp up period.
- `ramp_up_start_time` - The start time of the ramp up period.

Type:

```hcl
list(object({
name = string
days_of_week = list(string)
ramp_up_start_time = string
ramp_up_load_balancing_algorithm = string
ramp_up_minimum_hosts_percent = number
ramp_up_capacity_threshold_percent = number
peak_start_time = string
peak_load_balancing_algorithm = string
ramp_down_start_time = string
ramp_down_load_balancing_algorithm = string
ramp_down_minimum_hosts_percent = number
ramp_down_force_logoff_users = bool
ramp_down_wait_time_minutes = number
ramp_down_notification_message = string
ramp_down_capacity_threshold_percent = number
ramp_down_stop_hosts_when = string
off_peak_start_time = string
off_peak_load_balancing_algorithm = string
}))
```

### <a name="input_time_zone"></a> [time\_zone](#input\_time\_zone)

Description: The time zone of the AVD Scaling Plan.

Type: `string`

Expand Down Expand Up @@ -150,87 +210,6 @@ map(object({

Default: `{}`

### <a name="input_schedules"></a> [schedules](#input\_schedules)

Description: A map of schedules to create on AVD Scaling Plan. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

- `name` - The name of the schedule.
- `days_of_week` - The days of the week to apply the schedule to.
- `off_peak_start_time` - The start time of the off peak period.
- `off_peak_load_balancing_algorithm` - The load balancing algorithm to use during the off peak period.
- `ramp_down_capacity_threshold_percent` - The capacity threshold percentage to use during the ramp down period.
- `ramp_down_force_logoff_users` - Whether to force log off users during the ramp down period.
- `ramp_down_load_balancing_algorithm` - The load balancing algorithm to use during the ramp down period.
- `ramp_down_minimum_hosts_percent` - The minimum hosts percentage to use during the ramp down period.
- `ramp_down_notification_message` - The notification message to use during the ramp down period.
- `ramp_down_start_time` - The start time of the ramp down period.
- `ramp_down_stop_hosts_when` - When to stop hosts during the ramp down period.
- `ramp_down_wait_time_minutes` - The wait time in minutes to use during the ramp down period.
- `peak_start_time` - The start time of the peak period.
- `peak_load_balancing_algorithm` - The load balancing algorithm to use during the peak period.
- `ramp_up_capacity_threshold_percent` - (Optional) The capacity threshold percentage to use during the ramp up period.
- `ramp_up_load_balancing_algorithm` - The load balancing algorithm to use during the ramp up period.
- `ramp_up_minimum_hosts_percent` - (Optional) The minimum hosts percentage to use during the ramp up period.
- `ramp_up_start_time` - The start time of the ramp up period.

Type:

```hcl
map(object({
name = string
days_of_week = set(string)
off_peak_start_time = string
off_peak_load_balancing_algorithm = string
ramp_down_capacity_threshold_percent = number
ramp_down_force_logoff_users = bool
ramp_down_load_balancing_algorithm = string
ramp_down_minimum_hosts_percent = number
ramp_down_notification_message = string
ramp_down_start_time = string
ramp_down_stop_hosts_when = string
ramp_down_wait_time_minutes = number
peak_start_time = string
peak_load_balancing_algorithm = string
ramp_up_capacity_threshold_percent = optional(number)
ramp_up_load_balancing_algorithm = string
ramp_up_minimum_hosts_percent = optional(number)
ramp_up_start_time = string
}))
```

Default:

```json
{
"schedule1": {
"days_of_week": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"name": "Weekdays",
"off_peak_load_balancing_algorithm": "DepthFirst",
"off_peak_start_time": "22:00",
"peak_load_balancing_algorithm": "BreadthFirst",
"peak_start_time": "09:00",
"ramp_down_capacity_threshold_percent": 5,
"ramp_down_force_logoff_users": false,
"ramp_down_load_balancing_algorithm": "DepthFirst",
"ramp_down_minimum_hosts_percent": 10,
"ramp_down_notification_message": "Please log off in the next 45 minutes...",
"ramp_down_start_time": "19:00",
"ramp_down_stop_hosts_when": "ZeroSessions",
"ramp_down_wait_time_minutes": 45,
"ramp_up_capacity_threshold_percent": 10,
"ramp_up_load_balancing_algorithm": "BreadthFirst",
"ramp_up_minimum_hosts_percent": 20,
"ramp_up_start_time": "05:00"
}
}
```

### <a name="input_tags"></a> [tags](#input\_tags)

Description: Map of tags to assign to the Scaling Plan resource.
Expand All @@ -239,14 +218,6 @@ Type: `map(any)`

Default: `null`

### <a name="input_time_zone"></a> [time\_zone](#input\_time\_zone)

Description: The time zone of the AVD Scaling Plan.

Type: `string`

Default: `"Eastern Standard Time"`

### <a name="input_tracing_tags_enabled"></a> [tracing\_tags\_enabled](#input\_tracing\_tags\_enabled)

Description: Whether enable tracing tags that generated by BridgeCrew Yor.
Expand Down
70 changes: 66 additions & 4 deletions examples/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,54 @@ module "scplan" {
enable_telemetry = var.enable_telemetry
resource_group_name = data.azurerm_virtual_desktop_host_pool.name.resource_group_name
location = data.azurerm_virtual_desktop_host_pool.name.location
scalingplan = var.scalingplan
name = var.name
time_zone = var.time_zone
description = var.description
hostpool = data.azurerm_virtual_desktop_host_pool.name.name
schedule = toset(
[
{
name = "Weekday"
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
ramp_up_start_time = "09:00"
ramp_up_load_balancing_algorithm = "BreadthFirst"
ramp_up_minimum_hosts_percent = 50
ramp_up_capacity_threshold_percent = 80
peak_start_time = "10:00"
peak_load_balancing_algorithm = "DepthFirst"
ramp_down_start_time = "17:00"
ramp_down_load_balancing_algorithm = "BreadthFirst"
ramp_down_minimum_hosts_percent = 50
ramp_down_force_logoff_users = true
ramp_down_wait_time_minutes = 15
ramp_down_notification_message = "The session will end in 15 minutes."
ramp_down_capacity_threshold_percent = 50
ramp_down_stop_hosts_when = "ZeroActiveSessions"
off_peak_start_time = "18:00"
off_peak_load_balancing_algorithm = "BreadthFirst"
},
{
name = "Weekend"
days_of_week = ["Saturday", "Sunday"]
ramp_up_start_time = "09:00"
ramp_up_load_balancing_algorithm = "BreadthFirst"
ramp_up_minimum_hosts_percent = 50
ramp_up_capacity_threshold_percent = 80
peak_start_time = "10:00"
peak_load_balancing_algorithm = "DepthFirst"
ramp_down_start_time = "17:00"
ramp_down_load_balancing_algorithm = "BreadthFirst"
ramp_down_minimum_hosts_percent = 50
ramp_down_force_logoff_users = true
ramp_down_wait_time_minutes = 15
ramp_down_notification_message = "The session will end in 15 minutes."
ramp_down_capacity_threshold_percent = 50
ramp_down_stop_hosts_when = "ZeroActiveSessions"
off_peak_start_time = "18:00"
off_peak_load_balancing_algorithm = "BreadthFirst"
}
]
)
}
```

Expand Down Expand Up @@ -64,6 +110,14 @@ No required inputs.

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

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

Description: The description of the AVD Scaling Plan.

Type: `string`

Default: `"AVD Scaling Plan"`

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

Description: This variable controls whether or not telemetry is enabled for the module.
Expand All @@ -82,6 +136,14 @@ Type: `string`

Default: `"avdhostpool"`

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

Description: The name of the AVD Scaling Plan.

Type: `string`

Default: `"avdscalingplan"`

### <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 @@ -90,13 +152,13 @@ Type: `string`

Default: `"rg-avm-test"`

### <a name="input_scalingplan"></a> [scalingplan](#input\_scalingplan)
### <a name="input_time_zone"></a> [time\_zone](#input\_time\_zone)

Description: The name of the AVD Scaling Plan.
Description: The time zone of the AVD Scaling Plan.

Type: `string`

Default: `"avdscalingplan"`
Default: `"Eastern Standard Time"`

## Outputs

Expand Down
48 changes: 47 additions & 1 deletion examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,52 @@ module "scplan" {
enable_telemetry = var.enable_telemetry
resource_group_name = data.azurerm_virtual_desktop_host_pool.name.resource_group_name
location = data.azurerm_virtual_desktop_host_pool.name.location
scalingplan = var.scalingplan
name = var.name
time_zone = var.time_zone
description = var.description
hostpool = data.azurerm_virtual_desktop_host_pool.name.name
schedule = toset(
[
{
name = "Weekday"
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
ramp_up_start_time = "09:00"
ramp_up_load_balancing_algorithm = "BreadthFirst"
ramp_up_minimum_hosts_percent = 50
ramp_up_capacity_threshold_percent = 80
peak_start_time = "10:00"
peak_load_balancing_algorithm = "DepthFirst"
ramp_down_start_time = "17:00"
ramp_down_load_balancing_algorithm = "BreadthFirst"
ramp_down_minimum_hosts_percent = 50
ramp_down_force_logoff_users = true
ramp_down_wait_time_minutes = 15
ramp_down_notification_message = "The session will end in 15 minutes."
ramp_down_capacity_threshold_percent = 50
ramp_down_stop_hosts_when = "ZeroActiveSessions"
off_peak_start_time = "18:00"
off_peak_load_balancing_algorithm = "BreadthFirst"
},
{
name = "Weekend"
days_of_week = ["Saturday", "Sunday"]
ramp_up_start_time = "09:00"
ramp_up_load_balancing_algorithm = "BreadthFirst"
ramp_up_minimum_hosts_percent = 50
ramp_up_capacity_threshold_percent = 80
peak_start_time = "10:00"
peak_load_balancing_algorithm = "DepthFirst"
ramp_down_start_time = "17:00"
ramp_down_load_balancing_algorithm = "BreadthFirst"
ramp_down_minimum_hosts_percent = 50
ramp_down_force_logoff_users = true
ramp_down_wait_time_minutes = 15
ramp_down_notification_message = "The session will end in 15 minutes."
ramp_down_capacity_threshold_percent = 50
ramp_down_stop_hosts_when = "ZeroActiveSessions"
off_peak_start_time = "18:00"
off_peak_load_balancing_algorithm = "BreadthFirst"
}
]
)
}
15 changes: 14 additions & 1 deletion examples/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@ If it is set to false, then no telemetry will be collected.
DESCRIPTION
}

variable "scalingplan" {
variable "name" {
type = string
default = "avdscalingplan"
description = "The name of the AVD Scaling Plan."
}

variable "description" {
type = string
default = "AVD Scaling Plan"
description = "The description of the AVD Scaling Plan."

}

variable "time_zone" {
type = string
description = "The time zone of the AVD Scaling Plan."
default = "Eastern Standard Time"
}

variable "host_pool" {
type = string
default = "avdhostpool"
Expand Down
Loading

0 comments on commit f06aa55

Please sign in to comment.