Skip to content

azurermLabServicePlan

Manages a Lab Service Plan.

-> Note: Before using this resource, it's required to submit the request of registering the provider with Azure CLI azProviderRegisterNamespaceMicrosoftLabServices.

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 azurermLabServicePlanExample = new azurerm.labServicePlan.LabServicePlan(
  this,
  "example_1",
  {
    allowed_regions: [azurermResourceGroupExample.location],
    location: azurermResourceGroupExample.location,
    name: "example-lp",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLabServicePlanExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of the Lab Service Plan. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group where the Lab Service Plan should exist. Changing this forces a new resource to be created.

  • location - (Required) The Azure Region where the Lab Service Plan should exist. Changing this forces a new resource to be created.

  • allowedRegions - (Required) The allowed regions for the lab creator to use when creating labs using this Lab Service Plan. The allowed region's count must be between 1 and 28.

  • defaultAutoShutdown - (Optional) A defaultAutoShutdown block as defined below.

  • defaultConnection - (Optional) A defaultConnection block as defined below.

  • defaultNetworkSubnetId - (Optional) The resource ID of the Subnet for the Lab Service Plan network profile.

  • sharedGalleryId - (Optional) The resource ID of the Shared Image Gallery attached to this Lab Service Plan. When saving a lab template virtual machine image it will be persisted in this gallery. The shared images from the gallery can be made available to use when creating new labs.

\~> NOTE: The built-in azureLabServices Service Principal with role needs to be assigned to the Shared Image Gallery while using this property.

  • support - (Optional) A support block as defined below.

  • tags - (Optional) A mapping of tags which should be assigned to the Lab Service Plan.


A defaultAutoShutdown block supports the following:

  • disconnectDelay - (Optional) The amount of time a VM will stay running after a user disconnects if this behavior is enabled. This value must be formatted as an ISO 8601 string.

  • idleDelay - (Optional) The amount of time a VM will idle before it is shutdown if this behavior is enabled. This value must be formatted as an ISO 8601 string.

  • noConnectDelay - (Optional) The amount of time a VM will stay running before it is shutdown if no connection is made and this behavior is enabled. This value must be formatted as an ISO 8601 string.

  • shutdownOnIdle - (Optional) Will a VM get shutdown when it has idled for a period of time? Possible values are lowUsage and userAbsence.

\~> NOTE: This property is none when it isn't specified. No need to set idleDelay when shutdownOnIdle isn't specified.


A defaultConnection block supports the following:

  • clientRdpAccess - (Optional) The enabled access level for Client Access over RDP. Possible values are private and public.

\~> NOTE: This property is none when it isn't specified.

  • clientSshAccess - (Optional) The enabled access level for Client Access over SSH. Possible values are private and public.

\~> NOTE: This property is none when it isn't specified.

  • webRdpAccess - (Optional) The enabled access level for Web Access over RDP. Possible values are private and public.

\~> NOTE: This property is none when it isn't specified.

  • webSshAccess - (Optional) The enabled access level for Web Access over SSH. Possible values are private and public.

\~> NOTE: This property is none when it isn't specified.


A support block supports the following:

  • email - (Optional) The email address for the support contact.

  • instructions - (Optional) The instructions for users of the Lab Service Plan.

  • phone - (Optional) The phone number for the support contact.

  • url - (Optional) The web address for users of the Lab Service Plan.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Lab Service Plan.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Lab Service Plan.
  • read - (Defaults to 5 minutes) Used when retrieving the Lab Service Plan.
  • update - (Defaults to 30 minutes) Used when updating the Lab Service Plan.
  • delete - (Defaults to 30 minutes) Used when deleting the Lab Service Plan.

Import

Lab Service Plans can be imported using the resourceId, e.g.

terraform import azurerm_lab_service_plan.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.LabServices/labPlans/labPlan1