Lab

class Lab : KotlinCustomResource

The lab resource. Uses Azure REST API version 2023-06-07. In version 2.x of the Azure Native provider, it used API version 2022-08-01. Other available API versions: 2021-10-01-preview, 2021-11-15-preview, 2022-08-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native labservices [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

putLab

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var lab = new AzureNative.LabServices.Lab("lab", new()
{
AutoShutdownProfile = new AzureNative.LabServices.Inputs.AutoShutdownProfileArgs
{
DisconnectDelay = "PT5M",
IdleDelay = "PT5M",
NoConnectDelay = "PT5M",
ShutdownOnDisconnect = AzureNative.LabServices.EnableState.Enabled,
ShutdownOnIdle = AzureNative.LabServices.ShutdownOnIdleMode.UserAbsence,
ShutdownWhenNotConnected = AzureNative.LabServices.EnableState.Enabled,
},
ConnectionProfile = new AzureNative.LabServices.Inputs.ConnectionProfileArgs
{
ClientRdpAccess = AzureNative.LabServices.ConnectionType.Public,
ClientSshAccess = AzureNative.LabServices.ConnectionType.Public,
WebRdpAccess = AzureNative.LabServices.ConnectionType.None,
WebSshAccess = AzureNative.LabServices.ConnectionType.None,
},
Description = "This is a test lab.",
LabName = "testlab",
LabPlanId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan",
Location = "westus",
NetworkProfile = new AzureNative.LabServices.Inputs.LabNetworkProfileArgs
{
SubnetId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default",
},
ResourceGroupName = "testrg123",
SecurityProfile = new AzureNative.LabServices.Inputs.SecurityProfileArgs
{
OpenAccess = AzureNative.LabServices.EnableState.Disabled,
},
Title = "Test Lab",
VirtualMachineProfile = new AzureNative.LabServices.Inputs.VirtualMachineProfileArgs
{
AdditionalCapabilities = new AzureNative.LabServices.Inputs.VirtualMachineAdditionalCapabilitiesArgs
{
InstallGpuDrivers = AzureNative.LabServices.EnableState.Disabled,
},
AdminUser = new AzureNative.LabServices.Inputs.CredentialsArgs
{
Username = "test-user",
},
CreateOption = AzureNative.LabServices.CreateOption.TemplateVM,
ImageReference = new AzureNative.LabServices.Inputs.ImageReferenceArgs
{
Offer = "WindowsServer",
Publisher = "Microsoft",
Sku = "2019-Datacenter",
Version = "2019.0.20190410",
},
Sku = new AzureNative.LabServices.Inputs.SkuArgs
{
Name = "Medium",
},
UsageQuota = "PT10H",
UseSharedPassword = AzureNative.LabServices.EnableState.Disabled,
},
});
});
package main
import (
labservices "github.com/pulumi/pulumi-azure-native-sdk/labservices/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := labservices.NewLab(ctx, "lab", &labservices.LabArgs{
AutoShutdownProfile: &labservices.AutoShutdownProfileArgs{
DisconnectDelay: pulumi.String("PT5M"),
IdleDelay: pulumi.String("PT5M"),
NoConnectDelay: pulumi.String("PT5M"),
ShutdownOnDisconnect: labservices.EnableStateEnabled,
ShutdownOnIdle: labservices.ShutdownOnIdleModeUserAbsence,
ShutdownWhenNotConnected: labservices.EnableStateEnabled,
},
ConnectionProfile: &labservices.ConnectionProfileArgs{
ClientRdpAccess: labservices.ConnectionTypePublic,
ClientSshAccess: labservices.ConnectionTypePublic,
WebRdpAccess: labservices.ConnectionTypeNone,
WebSshAccess: labservices.ConnectionTypeNone,
},
Description: pulumi.String("This is a test lab."),
LabName: pulumi.String("testlab"),
LabPlanId: pulumi.String("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan"),
Location: pulumi.String("westus"),
NetworkProfile: &labservices.LabNetworkProfileArgs{
SubnetId: pulumi.String("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
},
ResourceGroupName: pulumi.String("testrg123"),
SecurityProfile: &labservices.SecurityProfileArgs{
OpenAccess: labservices.EnableStateDisabled,
},
Title: pulumi.String("Test Lab"),
VirtualMachineProfile: &labservices.VirtualMachineProfileArgs{
AdditionalCapabilities: &labservices.VirtualMachineAdditionalCapabilitiesArgs{
InstallGpuDrivers: labservices.EnableStateDisabled,
},
AdminUser: &labservices.CredentialsArgs{
Username: pulumi.String("test-user"),
},
CreateOption: labservices.CreateOptionTemplateVM,
ImageReference: &labservices.ImageReferenceArgs{
Offer: pulumi.String("WindowsServer"),
Publisher: pulumi.String("Microsoft"),
Sku: pulumi.String("2019-Datacenter"),
Version: pulumi.String("2019.0.20190410"),
},
Sku: &labservices.SkuArgs{
Name: pulumi.String("Medium"),
},
UsageQuota: pulumi.String("PT10H"),
UseSharedPassword: labservices.EnableStateDisabled,
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.labservices.Lab;
import com.pulumi.azurenative.labservices.LabArgs;
import com.pulumi.azurenative.labservices.inputs.AutoShutdownProfileArgs;
import com.pulumi.azurenative.labservices.inputs.ConnectionProfileArgs;
import com.pulumi.azurenative.labservices.inputs.LabNetworkProfileArgs;
import com.pulumi.azurenative.labservices.inputs.SecurityProfileArgs;
import com.pulumi.azurenative.labservices.inputs.VirtualMachineProfileArgs;
import com.pulumi.azurenative.labservices.inputs.VirtualMachineAdditionalCapabilitiesArgs;
import com.pulumi.azurenative.labservices.inputs.CredentialsArgs;
import com.pulumi.azurenative.labservices.inputs.ImageReferenceArgs;
import com.pulumi.azurenative.labservices.inputs.SkuArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var lab = new Lab("lab", LabArgs.builder()
.autoShutdownProfile(AutoShutdownProfileArgs.builder()
.disconnectDelay("PT5M")
.idleDelay("PT5M")
.noConnectDelay("PT5M")
.shutdownOnDisconnect("Enabled")
.shutdownOnIdle("UserAbsence")
.shutdownWhenNotConnected("Enabled")
.build())
.connectionProfile(ConnectionProfileArgs.builder()
.clientRdpAccess("Public")
.clientSshAccess("Public")
.webRdpAccess("None")
.webSshAccess("None")
.build())
.description("This is a test lab.")
.labName("testlab")
.labPlanId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan")
.location("westus")
.networkProfile(LabNetworkProfileArgs.builder()
.subnetId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")
.build())
.resourceGroupName("testrg123")
.securityProfile(SecurityProfileArgs.builder()
.openAccess("Disabled")
.build())
.title("Test Lab")
.virtualMachineProfile(VirtualMachineProfileArgs.builder()
.additionalCapabilities(VirtualMachineAdditionalCapabilitiesArgs.builder()
.installGpuDrivers("Disabled")
.build())
.adminUser(CredentialsArgs.builder()
.username("test-user")
.build())
.createOption("TemplateVM")
.imageReference(ImageReferenceArgs.builder()
.offer("WindowsServer")
.publisher("Microsoft")
.sku("2019-Datacenter")
.version("2019.0.20190410")
.build())
.sku(SkuArgs.builder()
.name("Medium")
.build())
.usageQuota("PT10H")
.useSharedPassword("Disabled")
.build())
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:labservices:Lab testlabplan /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}

Properties

Link copied to clipboard

The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard

The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open.

Link copied to clipboard
val description: Output<String>?

The description of the lab.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val labPlanId: Output<String>?

The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization..

Link copied to clipboard
val location: Output<String>

The geo-location where the resource lives

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard

The network profile for the lab, typically applied via a lab plan. This profile cannot be modified once a lab has been created.

Link copied to clipboard

Current provisioning state of the lab.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Error details of last operation done on lab.

Link copied to clipboard

The lab user list management profile.

Link copied to clipboard

The lab security profile.

Link copied to clipboard
val state: Output<String>

The lab state.

Link copied to clipboard

Metadata pertaining to creation and last modification of the lab.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard
val title: Output<String>?

The title of the lab.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The profile used for creating lab virtual machines.