azurermVirtualDesktopHostPool
Manages a Virtual Desktop Host Pool.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermVirtualDesktopHostPoolExample =
new azurerm.virtualDesktopHostPool.VirtualDesktopHostPool(this, "example_1", {
custom_rdp_properties: "audiocapturemode:i:1;audiomode:i:0;",
description: "Acceptance Test: A pooled host pool - pooleddepthfirst",
friendly_name: "pooleddepthfirst",
load_balancer_type: "DepthFirst",
location: azurermResourceGroupExample.location,
maximum_sessions_allowed: 50,
name: "pooleddepthfirst",
resource_group_name: azurermResourceGroupExample.name,
scheduled_agent_updates: [
{
enabled: true,
schedule: [
{
day_of_week: "Saturday",
hour_of_day: 2,
},
],
},
],
start_vm_on_connect: true,
type: "Pooled",
validate_environment: true,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualDesktopHostPoolExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name- (Required) The name of the Virtual Desktop Host Pool. Changing this forces a new resource to be created. -
resourceGroupName- (Required) The name of the resource group in which to create the Virtual Desktop Host Pool. Changing this forces a new resource to be created. -
location- (Required) The location/region where the Virtual Desktop Host Pool is located. Changing this forces a new resource to be created. -
type- (Required) The type of the Virtual Desktop Host Pool. Valid options arepersonalorpooled. Changing the type forces a new resource to be created. -
loadBalancerType- (Required)breadthFirstload balancing distributes new user sessions across all available session hosts in the host pool. Possible values arebreadthFirst,depthFirstandpersistent.depthFirstload balancing distributes new user sessions to an available session host with the highest number of connections but has not reached its maximum session limit threshold.persistentshould be used if the host pool type ispersonal -
friendlyName- (Optional) A friendly name for the Virtual Desktop Host Pool. -
description- (Optional) A description for the Virtual Desktop Host Pool. -
validateEnvironment- (Optional) Allows you to test service changes before they are deployed to production. Defaults tofalse. -
startVmOnConnect- (Optional) Enables or disables the Start VM on Connection Feature. Defaults tofalse. -
customRdpProperties- (Optional) A valid custom RDP properties string for the Virtual Desktop Host Pool, available properties can be found in this article. -
personalDesktopAssignmentType- (Optional)automaticassignment – The service will select an available host and assign it to an user. Possible values areautomaticanddirect.directAssignment – Admin selects a specific host to assign to an user. Changing this forces a new resource to be created.
\~> NOTE: personalDesktopAssignmentType is required if the type of your Virtual Desktop Host Pool is personal
-
maximumSessionsAllowed- (Optional) A valid integer value from 0 to 999999 for the maximum number of users that have concurrent sessions on a session host. Should only be set if thetypeof your Virtual Desktop Host Pool ispooled. -
preferredAppGroupType- (Optional) Option to specify the preferred Application Group type for the Virtual Desktop Host Pool. Valid options arenone,desktoporrailApplications. Default isnone. Changing this forces a new resource to be created. -
scheduledAgentUpdates- (Optional) AscheduledAgentUpdatesblock as defined below. This enables control of when Agent Updates will be applied to Session Hosts. -
tags- (Optional) A mapping of tags to assign to the resource.
A scheduledAgentUpdates block supports the following:
enabled- (Optional) Enables or disables scheduled updates of the AVD agent components (RDAgent, Geneva Monitoring agent, and side-by-side stack) on session hosts. If this is enabled then up to twoscheduleblocks must be defined. Default isfalse.
\~> NOTE: if enabled is set to true then at least one and a maximum of two schedule blocks must be provided.
timezone- (Optional) Specifies the time zone in which the agent update schedule will apply, the possible values are defined here. IfuseSessionHostTimezoneis enabled then it will override this setting. Default isutcuseSessionHostTimezone- (Optional) Specifies whether scheduled agent updates should be applied based on the timezone of the affected session host. If configured then this setting overridestimezone. Default isfalse.schedule- (Optional) Ascheduleblock as defined below. A maximum of two blocks can be added.
A schedule block supports the following:
dayOfWeek- (Required) The day of the week on which agent updates should be performed. Possible values aremonday,tuesday,wednesday,thursday,friday,saturday, andsundayhourOfDay- (Required) The hour of day the update window should start. The update is a 2 hour period following the hour provided. The value should be provided as a number between 0 and 23, with 0 being midnight and 23 being 11pm. A leading zero should not be used.
Attributes Reference
In addition to the Arguments listed above - the following Attributes are exported:
id- The ID of the Virtual Desktop Host Pool.
Timeouts
The timeouts block allows you to specify timeouts for certain actions:
create- (Defaults to 60 minutes) Used when creating the Virtual Desktop Host Pool.update- (Defaults to 60 minutes) Used when updating the Virtual Desktop Host Pool.read- (Defaults to 5 minutes) Used when retrieving the Virtual Desktop Host Pool.delete- (Defaults to 60 minutes) Used when deleting the Virtual Desktop Host Pool.
Import
Virtual Desktop Host Pools can be imported using the resourceId, e.g.